Jump to content

Custom number of products in category


Recommended Posts

Hi, I want to diplay 6 products in category 3,7,9 and for rest as set in configuration (9).

 

To make it simple lets make it display 6 products per page instead of set in configuration (9), no matter of what category:

 We have 25 products in category

 In modules/blocklayered/blocklayered.php I changed every Configuration::get('PS_PRODUCTS_PER_PAGE') to 6. 

 Now we have on every page 6 products, but we have only 3 pages not 5, so for pagination it is still PS_PRODUCTS_PER_PAGE.

 

 If in classes/controller/FrontController.php in pagination method I change:

 $default_products_per_page = max(1, (int)Configuration::get('PS_PRODUCTS_PER_PAGE')); to

 $default_products_per_page = max(1, 6);

 then all works ok, but I don't want an override, because it is messy.

 

Can it be done in module, if so please let me know.   

Link to comment
Share on other sites

×
×
  • Create New...