johnxl Posted July 8, 2013 Share Posted July 8, 2013 (edited) Hello! Maybe there is a way to shuffle products ? I mean shuffle chaotic order in which products are displayed ! I found that there is option in control panel > catalog >products ,,there you can change position manually with arrows up and down ! But it is very complicated to change all products position ! Is there another way? Thanks ! Edited July 8, 2013 by johnxl (see edit history) 1 Link to comment Share on other sites More sharing options...
PascalVG Posted July 8, 2013 Share Posted July 8, 2013 Where exactly would you like them to be displayed in random order? Link to comment Share on other sites More sharing options...
johnxl Posted July 8, 2013 Author Share Posted July 8, 2013 here http://eksimanta.lv/lv/3-kuloni Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 Category::getProducts accepts a bool value for the random options. So, if you want to display random products in category, I would create a category controller override. Locate the call to getProducts and add TRUE to the random variable. Link to comment Share on other sites More sharing options...
johnxl Posted July 8, 2013 Author Share Posted July 8, 2013 Can you please explain in details ? Thanks ! Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 Prestashop version? Link to comment Share on other sites More sharing options...
johnxl Posted July 8, 2013 Author Share Posted July 8, 2013 version 1.5.4.0 Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 Ccontrollers/categoryController.php line 193: $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay); Change it into $this->cat_products = $this->category->getProducts($this->context->language->id, (int)$this->p, (int)$this->n, $this->orderBy, $this->orderWay, false, true, true); The last parameter is for random Link to comment Share on other sites More sharing options...
vekia Posted July 8, 2013 Share Posted July 8, 2013 but what with pagination in this case? i never tested it so just want to ask about that. For example, with shuffle effect turned on, while browsing the pages of category i can see the same product several times? Am I right? Link to comment Share on other sites More sharing options...
NemoPS Posted July 8, 2013 Share Posted July 8, 2013 yeah, but I believe it's intended to show a certain number of products only. If it's random, it can't be retained when navigating I fear Link to comment Share on other sites More sharing options...
p.guerin Posted November 7, 2016 Share Posted November 7, 2016 Hi everybody Has somebody found a way to shuffle products in categories without having the same products in different pages..? Best Link to comment Share on other sites More sharing options...
NemoPS Posted November 7, 2016 Share Posted November 7, 2016 There is no way since they are randomly grabbed at each page load. Or, what you can do is modify their position in the database every once in a while, randomizing it. Link to comment Share on other sites More sharing options...
Recommended Posts