vegaskev Posted August 13, 2014 Share Posted August 13, 2014 How do I limit the amount of products displayed in the Top Sellers List (Best Sellers Block)? I notice there are no settings inside the module > configure screen. I'm still a little green on MVC & PrestaShop or I'd start hacking away at the blockbestsellers.php file. Any guidance would be greatly appreciated. Thanks in advance. Link to comment Share on other sites More sharing options...
vekia Posted August 13, 2014 Share Posted August 13, 2014 blockbestsellers.php there is a function protected function getBestSellers($params) { if (Configuration::get('PS_CATALOG_MODE')) return false; if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 8))) return (Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY') ? array() : false); $currency = new Currency($params['cookie']->id_currency); $usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC); foreach ($result as &$row) $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency); return $result; } change 8 in: if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 8))) to any other value you want Link to comment Share on other sites More sharing options...
vegaskev Posted August 14, 2014 Author Share Posted August 14, 2014 Vekia, that makes sense now that you pointed it out and I reread that line a few more times. Thanks for your help bro. I poured through the the code but I was looking for keywords like 'limit' or 'max', etc. lol. Link to comment Share on other sites More sharing options...
Recommended Posts