Jump to content

HOW TO: Numbering Product LIst ?


blietzkrieg

Recommended Posts

I wanted to know how to add Numbers on the product list.

i.e:
page 1 - numbers 1 - 10
page 2 - 11 - 20
... and so on..

and on top of page it says "Showing 1 to 10 products of 'TOTAL_RESULT'"

Is this one possible? And how could it be done?

Hope you could help me on this. .Thanks.

39426_n1xqiYGGCnwCsuKkcPoM_t

Link to comment
Share on other sites

insert lines in the beginning of
themes/your_theme/product-list.tpl

{assign var=n_start value=$p*$n-$n+1}
{assign var=n_end value=$p*$n}



now you can insert "Showing {$n_start} to {$n_end} products of {$nb_products}" to the desired place of template


For the numbering - place few lines into the following foreach cycle:

{foreach from=$products item=product name=products}
  ...
  ...
   {$n_start} {*this is the number of product. Insert it to the desired place*}
  ...
  ...
  {assign var=n_start value=`$n_start+1`}
{/foreach}

Link to comment
Share on other sites

$p and $n variables are accessible if they are used after include(dirname(__FILE__).'/pagination.php')

try {assign var=n_end value=$p*$n} in .tpl file and place {$n_end} somewhere in it.

If it will not work it is possible to use jQuery in product-list.tpl and insert any content to any place of the page (on the client side).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...