daninapoli Posted April 27, 2017 Share Posted April 27, 2017 Hi I use version 1.6.1.2, I need to randomly display the products of my catalog in the showcase.I saw that there is a possibility directly from the module configuration but the same products are always displayed.I found some previous post postings by modifying the homefeatured.php file for the version I use i will not work.Also I have set other products in the HOME category but are displayed always think of the last inserted.Is there a solution? Link to comment Share on other sites More sharing options...
vekia Posted April 27, 2017 Share Posted April 27, 2017 what is exact version of the module ? Link to comment Share on other sites More sharing options...
daninapoli Posted April 27, 2017 Author Share Posted April 27, 2017 module v1.8.1 Link to comment Share on other sites More sharing options...
vekia Posted April 28, 2017 Share Posted April 28, 2017 try to replace original function hookdisplayhome() with function that i attached below: public function hookDisplayHome($params) { $category = new Category((int)Configuration::get('HOME_FEATURED_CAT'), (int)Context::getContext()->language->id); $nb = (int)Configuration::get('HOME_FEATURED_NBR'); $this->_cacheProducts(); $this->smarty->assign( array( 'products' => $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 8), null, null, false, true, true, ($nb ? $nb : 8)), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), ) ); return $this->display(__FILE__, 'homefeatured.tpl'); } 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