Jean.M Posted December 17, 2014 Share Posted December 17, 2014 (edited) Bonjour, j'utilise le module inclus "produit phare" sur PS 1.6 J'ai bien sélectionné l'affichage aléatoire, mais suivant la fréquence de rafraîchissement n'est pas systématique... Je me retrouve donc avec des produits aléatoires qui ne le sont pas... Comment le corriger? Merci Edited January 7, 2016 by Jean.M (see edit history) Link to comment Share on other sites More sharing options...
numeretik Posted January 2, 2015 Share Posted January 2, 2015 Je confirme rencontrer la même difficulté. Est-ce lié à un problème de cache Smarty ? Merci à ceux qui répondrons. Emmanuel Link to comment Share on other sites More sharing options...
troc56 Posted January 5, 2015 Share Posted January 5, 2015 idem Link to comment Share on other sites More sharing options...
solmicro Posted January 6, 2016 Share Posted January 6, 2016 Bonjour Il faut changer dans : votredomaine.com/module/homefeatured/homefeatured.php public function hookDisplayHome($params) { if (!$this->isCached('homefeatured.tpl', $this->getCacheId())) { $this->_cacheProducts(); $this->smarty->assign( array( 'products' => HomeFeatured::$cache_products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), ) ); } return $this->display(__FILE__, 'homefeatured.tpl', $this->getCacheId()); } par : public function hookDisplayHome($params){ $category = new Category(Context::getContext()->shop->getCategory(), (int)Context::getContext()->language->id); $nb = (int)(Configuration::get('HOME_FEATURED_NBR')); /*$products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10));*/ $products = $category->getProducts((int)Context::getContext()->language->id, 1, ($nb ? $nb : 10), 'date_add', 'DESC', false, true, true, $nb); shuffle($products); $this->smarty->assign(array( 'products' => $products, 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'homeSize' => Image::getSize('home_default'), )); return $this->display(__FILE__, 'homefeatured.tpl'); } 2 Link to comment Share on other sites More sharing options...
Jean.M Posted January 7, 2016 Author Share Posted January 7, 2016 Merci @solmicro qui vient de règler un problème non résolu depuis maintenant plus d'un an!!! Je marque le sujet comme résolu en espérant que cela puisse aider d'autres personnes dans mon cas... c'est d'ailleurs étonnant qu'il n'y en est pas plus! Encore merci! Link to comment Share on other sites More sharing options...
numeretik Posted January 27, 2016 Share Posted January 27, 2016 Merci beaucoup ! ça fait du bien de voir que certains vous aident ! A charge de revanche : je n'hésiterai pas à aider si je peux sur un autre sujet Bien cordialement Emmanuel Link to comment Share on other sites More sharing options...
Mühldorfer-france Posted January 4, 2017 Share Posted January 4, 2017 astuce fonctionnant sous 1.6.0.13 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