ltempest Posted April 25, 2012 Share Posted April 25, 2012 HELP! How do I limit the best sellers block included with Prestashop to only show a certain number of items? I cannot find any configuration in the module. Do I need to add code to the {for each} loop in the tpl file? Thanks Lee UPDATE OK spent some time Googling and came up with this answer: In the blockbestsellers-html.tpl file just after this line (38) {foreach from=$best_sellers item=product name=myLoop} insert: {if $product@iteration == 4} {break} Change the value of the red 4 above to be the number of products you wish to show +1, ie if you want to show 5 products then the value is 6. Hope that helps someone. Link to comment Share on other sites More sharing options...
bside2234 Posted November 17, 2012 Share Posted November 17, 2012 I tried adding this and it isn't working. Wonder what I'm doing wrong? Link to comment Share on other sites More sharing options...
gypsy Posted November 20, 2012 Share Posted November 20, 2012 bump doesnt work for me either Link to comment Share on other sites More sharing options...
berta recchia Posted November 30, 2012 Share Posted November 30, 2012 This code didn't do anything in my case either. Link to comment Share on other sites More sharing options...
thomasp Posted May 3, 2013 Share Posted May 3, 2013 (edited) if you have prestashop 1.5x you can solve the problem by adding the following line to the blockbestsellers.tpl {foreach from=$best_sellers item=product name=myLoop} {if $smarty.foreach.myLoop.iteration > 3} {break}{/if} Edited May 3, 2013 by thomasp (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted May 3, 2013 Share Posted May 3, 2013 ab Version 1.5 löst man das Problem in der blockbestsellers.tpl durch einfügen der folgenden Zeile {foreach from=$best_sellers item=product name=myLoop} {if $smarty.foreach.myLoop.iteration > 3} {break}{/if} hey can you please use english language? this is english section Link to comment Share on other sites More sharing options...
Rhobur Posted February 15, 2014 Share Posted February 15, 2014 if you have prestashop 1.5x you can solve the problem by adding the following line to the blockbestsellers.tpl {foreach from=$best_sellers item=product name=myLoop} {if $smarty.foreach.myLoop.iteration > 3} {break}{/if} I have added this to productscategory.tpl of the productscategory module but it doesn't limit the <li>'s as I have hoped. Any advice? Regards, Link to comment Share on other sites More sharing options...
vekia Posted February 15, 2014 Share Posted February 15, 2014 productscateogry uses different foreach loop and diferent foreach name (myLoop) 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