tumil Posted July 11, 2016 Share Posted July 11, 2016 (edited) Hi Here's the site that I have a problem with: http://sabipolsklep.pl/najczesciej-kupowane This is the bestsellers page. As you can see, there are over 1300 products here. I would like to have only 25 of them. How can I edit blockbestsellers module to reach my goal? I tried to edit tpl and php files using solutions found in some old topics but nothing worked, so maybe I've done something wrong. Could you please post the right solution for this problem? Because there were many Edited July 12, 2016 by tumil (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 11, 2016 Share Posted July 11, 2016 controllers/BestSalesController.php $products = ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay); change it to: $products = ProductSale::getBestSales($this->context->language->id, 0, 25, $this->orderBy, $this->orderWay); and $this->productSort(); $nb_products = (int)ProductSale::getNbSales(); $this->pagination($nb_products); to $this->productSort(); $nb_products = 25; $this->pagination($nb_products); it may be necessary to clean shop cache too 1 Link to comment Share on other sites More sharing options...
tumil Posted July 12, 2016 Author Share Posted July 12, 2016 Works like a charm, thanks Link to comment Share on other sites More sharing options...
hjelmuap Posted September 8, 2018 Share Posted September 8, 2018 I have the same problem once again with 1.7.4 this time the solution is different and I can not figure it out. classes/ProductSale.php Link to comment Share on other sites More sharing options...
outlet.ee Posted March 8, 2023 Share Posted March 8, 2023 In 1.7 i changed the classes/PproductSale.php ln. 54: $sql = 'SELECT COUNT(ps.`id_product`) AS nb to $sql = 'SELECT CASE WHEN COUNT(ps.`id_product`)<240 THEN COUNT(ps.`id_product`) ELSE 240 END AS nb In my case it is possible that there might be less than the 240, so it will only show the amount there is a the time if it is less than 240. 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