diara.sk 2 Posted January 4, 2016 Posted January 4, 2016 (edited) Hi, please help me with this: i use latest PS and in New products block I need to set different number of products shown for home page and category page. How to do that? Thank you very much. Edited January 4, 2016 by El Patron (see edit history) Share this post Link to post Share on other sites
El Patron 2,874 Posted January 4, 2016 Posted January 4, 2016 (edited) Hi, and welcome to the forum. You will need 1) ftp access and 2) a code editor of some sort We are going to work with this file: moudles/blocknewproducts/blocknewproducts.php The following is 'untested'. 1) make a back up moudles/blocknewproducts/blocknewproducts.php (download/rename to something like blocknewproducts_bkup.php) 2) find this function protected function getNewProducts() 3) replace entire function with: (note in this example I use 10 for category) protected function getNewProducts() { if (!Configuration::get('NEW_PRODUCTS_NBR')) return; $newProducts = false; if (Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) if (isset($this->context->controller->php_self) && $this->context->controller->php_self == 'category') $newProducts = Product::getNewProducts((int) $this->context->language->id, 0, 10); else $newProducts = Product::getNewProducts((int) $this->context->language->id, 0, (int)Configuration::get('NEW_PRODUCTS_NBR')); if (!$newProducts && Configuration::get('PS_BLOCK_NEWPRODUCTS_DISPLAY')) return; return $newProducts; } Note: back office-->advanced parms-->clear cache (top right of screen)... Edited January 4, 2016 by El Patron (see edit history) 2 Share this post Link to post Share on other sites
diara.sk 2 Posted January 4, 2016 Posted January 4, 2016 My maan it worked like a charm! Thanks a lot again 1 Share this post Link to post Share on other sites
El Patron 2,874 Posted January 4, 2016 Posted January 4, 2016 you are most welcome and happy PrestaShopping. Share this post Link to post Share on other sites
Recommended Posts