Yngvi Posted March 28, 2014 Share Posted March 28, 2014 On the home page, there are three tabs....'New Arrivals', 'Popular' and 'Best sellers' I am able to limit the number of products in the other two blocks but not in the 'best sellers' block. Is there are way to limit the number of bestsellers displayed to for example four products. Link to comment Share on other sites More sharing options...
vekia Posted March 31, 2014 Share Posted March 31, 2014 unfortunately, there is no option in back office to define how many products you want to display in home best sellers module. but you can do it manually in module php file. so open it: /modules/blockbestsellers/blockbestsellers.php there is a code: if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 8))) 8 at the end of this code is a number of products you want to retrieve from database, increase/decrease it to achieve what you exactly expect. 2 Link to comment Share on other sites More sharing options...
vekia Posted March 31, 2014 Share Posted March 31, 2014 i totally forgot to mention that changes like that need recompilation of entire theme (module uses caching system) so go to adv. parameters > performance tab and click on button to clear shop cache & autoload. in some cases it is also necessary to turn on "force compile option" temporarily. 2 Link to comment Share on other sites More sharing options...
nathanielleee Posted March 31, 2014 Share Posted March 31, 2014 Maybe someone can help me with this. but it seems like i have to clear the cache almost every day since upgrading. If i do not, the home page tabs will show all tabs at the same time. cant figure out any other way to fix it i totally forgot to mention that changes like that need recompilation of entire theme (module uses caching system) so go to adv. parameters > performance tab and click on button to clear shop cache & autoload. in some cases it is also necessary to turn on "force compile option" temporarily. Link to comment Share on other sites More sharing options...
vekia Posted March 31, 2014 Share Posted March 31, 2014 hello any chance to see it live, while the problem occurs? Link to comment Share on other sites More sharing options...
Morten Borg Posted April 3, 2014 Share Posted April 3, 2014 Maybe someone can help me with this. but it seems like i have to clear the cache almost every day since upgrading. If i do not, the home page tabs will show all tabs at the same time. cant figure out any other way to fix it I have the same problem, seems like a bug. Link to comment Share on other sites More sharing options...
A-Z Hosting Posted July 25, 2014 Share Posted July 25, 2014 (edited) Actually with 1.6 upgrading modules so frequently you really don't want to update the bestsellers.php file as it's going to get overwritten by an upgrade. You should do it in the theme tpl file at {yourtheme}/modules/bestsellers/bestsellers.tpl. Notice the reduction variable I used here. Change the max_best to the maximum bestsellers you want displayed: <!-- MODULE Block best sellers --> <div id="best-sellers_block_right" class="block products_block"> <h4 class="title_block"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='View a top sellers products' mod='blockbestsellers'}">{l s='Top sellers' mod='blockbestsellers'}</a> </h4> <div class="block_content"> {assign var="i" value=0} {assign var="max_best" value=4} {if $best_sellers && $best_sellers|@count > 0} <ul class="block_content products-block"> {foreach from=$best_sellers item=product name=myLoop} {if $i < $max_best} <li class="clearfix"> <a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}" class="products-block-image content_img clearfix"> <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html'}" alt="{$product.legend|escape:'html':'UTF-8'}" /> </a> <div class="product-content"> <h5> <a class="product-name" href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}"> {$product.name|strip_tags:'UTF-8'|escape:'html':'UTF-8'} </a> </h5> <p class="product-description">{$product.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</p> {if !$PS_CATALOG_MODE} <div class="price-box"> <span class="price">{$product.price}</span> </div> {/if} </div> </li> {assign var="i" value=$i+1} {/if} {/foreach} </ul> <div class="lnk"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='All best sellers' mod='blockbestsellers'}" class="btn btn-default button button-small"><span>{l s='All best sellers' mod='blockbestsellers'}<i class="icon-chevron-right right"></i></span></a> </div> {else} <p>{l s='No best sellers at this time' mod='blockbestsellers'}</p> {/if} </div> </div> <!-- /MODULE Block best sellers --> Hope that helps somebody. Wil Edited July 25, 2014 by A-Z Hosting (see edit history) 4 Link to comment Share on other sites More sharing options...
Rosie Posy Posted October 7, 2014 Share Posted October 7, 2014 (edited) Actually with 1.6 upgrading modules so frequently you really don't want to update the bestsellers.php file as it's going to get overwritten by an upgrade. You should do it in the theme tpl file at {yourtheme}/modules/bestsellers/bestsellers.tpl. Notice the reduction variable I used here. Change the max_best to the maximum bestsellers you want displayed: <!-- MODULE Block best sellers --> <div id="best-sellers_block_right" class="block products_block"> <h4 class="title_block"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='View a top sellers products' mod='blockbestsellers'}">{l s='Top sellers' mod='blockbestsellers'}</a> </h4> <div class="block_content"> {assign var="i" value=0} {assign var="max_best" value=4} {if $best_sellers && $best_sellers|@count > 0} <ul class="block_content products-block"> {foreach from=$best_sellers item=product name=myLoop} {if $i < $max_best} <li class="clearfix"> <a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}" class="products-block-image content_img clearfix"> <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'small_default')|escape:'html'}" alt="{$product.legend|escape:'html':'UTF-8'}" /> </a> <div class="product-content"> <h5> <a class="product-name" href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}"> {$product.name|strip_tags:'UTF-8'|escape:'html':'UTF-8'} </a> </h5> <p class="product-description">{$product.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</p> {if !$PS_CATALOG_MODE} <div class="price-box"> <span class="price">{$product.price}</span> </div> {/if} </div> </li> {assign var="i" value=$i+1} {/if} {/foreach} </ul> <div class="lnk"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='All best sellers' mod='blockbestsellers'}" class="btn btn-default button button-small"><span>{l s='All best sellers' mod='blockbestsellers'}<i class="icon-chevron-right right"></i></span></a> </div> {else} <p>{l s='No best sellers at this time' mod='blockbestsellers'}</p> {/if} </div> </div> <!-- /MODULE Block best sellers --> Hope that helps somebody. Wil Hi guys, I would like to disable the best sellers tab on the front page. I have uninstalled the module but best sellers still shows. Any ideas how to 'disable ' the best sellers tab? I have cleared the cache 'force compilation' under the adv. parameters tab. refreshed my site but best sellers tab is still there. I don't know how to disable the tab. Thanks for the help :-D Len Edited October 7, 2014 by Rosie Posy (see edit history) Link to comment Share on other sites More sharing options...
mbarki chadi Posted November 17, 2014 Share Posted November 17, 2014 (edited) Personalize display module Leo top best sellers : Fichier ftp : /www/beta/modules/leoblockbestsellers/leoblockbestsellers.php Ligne = 179 : $bestsellers = $this->getProducts((int)$this->context->language->id, 1, (int)Configuration::get('PS_BLOCK_LEO_BESTSELLERS_LIMIT')); Replace with : $accessories_cat_id = id_catégories that u want to display; $category = new Category($accessories_cat_id); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); $bestsellers = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10)); Edited November 17, 2014 by mbarki chadi (see edit history) Link to comment Share on other sites More sharing options...
lucav87 Posted January 3, 2015 Share Posted January 3, 2015 UP! how can I limit the number of top seller in homepage? thanks! Luca 1 Link to comment Share on other sites More sharing options...
vekia Posted January 4, 2015 Share Posted January 4, 2015 hello solutions above don't meet your requirements ? 1 Link to comment Share on other sites More sharing options...
Smiles Posted January 31, 2015 Share Posted January 31, 2015 (edited) I have the same problem but no max_best.... <!-- MODULE Block best sellers --> <div id="best-sellers_block_right" class="block products_block"> <h4 class="title_block"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='View a top sellers products' mod='blockbestsellers'}">{l s='Top sellers' mod='blockbestsellers'}</a> </h4> <div class="block_content"> {if $best_sellers && $best_sellers|@count > 0} <ul class="block_content products-block"> {foreach from=$best_sellers item=product name=myLoop} <li class="clearfix"> <a href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}" class="products-block-image content_img clearfix"> <img class="replace-2x img-responsive" src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'tm_small_default')|escape:'html'}" alt="{$product.legend|escape:'html':'UTF-8'}" /> </a> <div class="product-content"> <h5> <a class="product-name" href="{$product.link|escape:'html'}" title="{$product.legend|escape:'html':'UTF-8'}"> {$product.name|strip_tags:'UTF-8'|escape:'html':'UTF-8'|truncate:40:'...'} </a> </h5> <p class="product-description">{$product.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</p> {if !$PS_CATALOG_MODE} <div class="price-box"> <span class="price">{$product.price}</span> </div> {/if} </div> </li> {/foreach} </ul> <div class="lnk"> <a href="{$link->getPageLink('best-sales')|escape:'html'}" title="{l s='All best sellers' mod='blockbestsellers'}" class="btn btn-default button button-small"> <span> {l s='All best sellers' mod='blockbestsellers'} <i class="icon-chevron-right right"></i> </span> </a> </div> {else} <p>{l s='No best sellers at this time' mod='blockbestsellers'}</p> {/if} </div> </div> <!-- /MODULE Block best sellers --> The file comes from: /themes/MYtheme/modules/blockbestsellers Edited January 31, 2015 by Smiles (see edit history) Link to comment Share on other sites More sharing options...
yashman Posted February 3, 2015 Share Posted February 3, 2015 (edited) First thanks for A-Z Hosting for the tips on reducing the count of best sellers. It indeed reduced the numbers to the required. However, I need some tips on how to tweak it further Home Page: Display all the Best-Sellers instead of the value fixed in the code Sub Pages: Show limited for instance 4 only best sellers in the left column "Top Sellers Block" Appreciate Edited February 3, 2015 by yashman (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts