z4m0lx3 Posted May 6, 2011 Share Posted May 6, 2011 Hello,I have this website www[dot]girl-fashion[dot]ro.I'm trying to put 6 products in the best sellers block in the right.Problem is it only shows 5 items and the 6th picture is a 404.gif and the link doesn't work either..This is how the blockbestsellers.tpl looks like: <!-- MODULE Block best sellers --> {l s='Top sellers' mod='blockbestsellers'} {if $best_sellers|@count > 0} getImageLink($best_sellers.0.link_rewrite, $best_sellers.0.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.0.legend}" /> {if $best_sellers|@count > 1}getImageLink($best_sellers.1.link_rewrite, $best_sellers.1.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.1.legend}" /> getImageLink($best_sellers.2.link_rewrite, $best_sellers.2.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.2.legend}" /> getImageLink($best_sellers.3.link_rewrite, $best_sellers.3.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.3.legend}" /> getImageLink($best_sellers.4.link_rewrite, $best_sellers.4.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.4.legend}" /> getImageLink($best_sellers.5.link_rewrite, $best_sellers.5.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.5.legend}" /> {/if} {l s='All best sellers' mod='blockbestsellers'} {else} {l s='No best sellers at this time' mod='blockbestsellers'} {/if} <!-- /MODULE Block best sellers --> What should I do?Thanks Link to comment Share on other sites More sharing options...
shokinro Posted May 7, 2011 Share Posted May 7, 2011 I guess this is not the best seller module issue.check if the same product shows image correctly in category or put it in home featured see if it is the same.maybe there is problem with your product image. Link to comment Share on other sites More sharing options...
z4m0lx3 Posted May 7, 2011 Author Share Posted May 7, 2011 The product shows correctly everywhere.I think I didn't modify the bestsellersbloc.tpl correctly.This was the original code: <!-- MODULE Block best sellers --> {l s='Top sellers' mod='blockbestsellers'} {if $best_sellers|@count > 0} getImageLink($best_sellers.0.link_rewrite, $best_sellers.0.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.0.legend}" /> {if $best_sellers|@count > 1}getImageLink($best_sellers.1.link_rewrite, $best_sellers.1.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.1.legend}" />{/if} {$product.name|escape:'htmlall':'UTF-8'} {l s='All best sellers' mod='blockbestsellers'} {else} {l s='No best sellers at this time' mod='blockbestsellers'} {/if} <!-- /MODULE Block best sellers --> I'm sure I didn't modify it correctly, I don't know much about php.Again this is what it looks like now: <!-- MODULE Block best sellers --> {l s='Top sellers' mod='blockbestsellers'} {if $best_sellers|@count > 0} getImageLink($best_sellers.0.link_rewrite, $best_sellers.0.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.0.legend}" /> {if $best_sellers|@count > 1}getImageLink($best_sellers.1.link_rewrite, $best_sellers.1.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.1.legend}" /> getImageLink($best_sellers.2.link_rewrite, $best_sellers.2.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.2.legend}" /> getImageLink($best_sellers.3.link_rewrite, $best_sellers.3.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.3.legend}" /> getImageLink($best_sellers.4.link_rewrite, $best_sellers.4.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.4.legend}" /> getImageLink($best_sellers.5.link_rewrite, $best_sellers.5.id_image, 'medium')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$best_sellers.5.legend}" /> {/if} {l s='All best sellers' mod='blockbestsellers'} {else} {l s='No best sellers at this time' mod='blockbestsellers'} {/if} <!-- /MODULE Block best sellers --> Link to comment Share on other sites More sharing options...
z4m0lx3 Posted May 7, 2011 Author Share Posted May 7, 2011 What I've noticed is that the link of that 404.gif image goes to the product page which I'm on at that time.Like if I'm on Product #1 page that thumbnail with 404.gif goes to Product #1 pageIf I'm on Product #5 page, it goes to Product #5 page. Link to comment Share on other sites More sharing options...
shokinro Posted May 7, 2011 Share Posted May 7, 2011 I guess you only retrieve 5 products, but try to display 6 products.So you need to change the code to retrieve 6 products.Change this line in /modules/blockbestsellers/blockbestsellers.phpFROM $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5); TO $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 6); hope this helps Link to comment Share on other sites More sharing options...
z4m0lx3 Posted May 7, 2011 Author Share Posted May 7, 2011 that did the trick!thank you! Link to comment Share on other sites More sharing options...
shokinro Posted May 7, 2011 Share Posted May 7, 2011 glad it works for you, please mark it as solved by adding [sOLVED] to the beginning of the subject of your first post. thanks Link to comment Share on other sites More sharing options...
NOSaint Posted July 22, 2013 Share Posted July 22, 2013 Worked for me too :-) Running 1.5.4 with installed theme, had to edit code in Theme folder {if $smarty.foreach.myLoop.iteration <= 3} Or whatever number you want to appear. Link to comment Share on other sites More sharing options...
Manuls Posted April 21, 2014 Share Posted April 21, 2014 An adition to this. If you want to change the number of items in Prestashop 1.5.4.1 in bestsellers block you have to edit the file in modules/blockbestsellers/blockbestellers-home.tpl and this line {assign var='nbItemsPerLine' value=3} Change value=3 for the number you want The one apported bye NOSaint works only if the numbers are the same. If not you have to change as I say Link to comment Share on other sites More sharing options...
Recommended Posts