blietzkrieg Posted March 1, 2011 Share Posted March 1, 2011 I wanted to know how to add Numbers on the product list. i.e:page 1 - numbers 1 - 10page 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. Link to comment Share on other sites More sharing options...
otzy Posted March 1, 2011 Share Posted March 1, 2011 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 templateFor 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 More sharing options...
blietzkrieg Posted March 1, 2011 Author Share Posted March 1, 2011 Wow! Thanks. It works Is there any way to display the {$n_end} to the left column in a different .tpl file? Link to comment Share on other sites More sharing options...
otzy Posted March 1, 2011 Share Posted March 1, 2011 $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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now