perflex Posted January 20, 2014 Share Posted January 20, 2014 hey bro i saw you tutorial about how to display featured prodcuts randomly, i need to do the same with categoryproducts (related products) Link to comment Share on other sites More sharing options...
tuk66 Posted January 20, 2014 Share Posted January 20, 2014 Use ORDER BY RAND() in SQL query to get records randomly. Link to comment Share on other sites More sharing options...
perflex Posted January 20, 2014 Author Share Posted January 20, 2014 Tnx Turk for ur useful relpy it seems useful but i was wondering if there is another way to do it like editing php file or something like this : http://mypresta.eu/en/art/tips-and-tricks/how-to-display-products-randomly-in-prestashop-home-featured-module.html Link to comment Share on other sites More sharing options...
vekia Posted January 20, 2014 Share Posted January 20, 2014 Ccontrollers/categoryController.phpline 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...
perflex Posted January 20, 2014 Author Share Posted January 20, 2014 tnx vekia u'r always here when we need help and every solution u give us works perfect u'r a great man Link to comment Share on other sites More sharing options...
vekia Posted January 21, 2014 Share Posted January 21, 2014 you're welcome glad to hear that i could help you a little i marked whole topic as solved with regards Milos Link to comment Share on other sites More sharing options...
Recommended Posts