Hello,
I was wondering if there is a way to display products randomly at default "sort by" option. Right now it seems like it is chosen by date add. I have different brands, so at default settings I have all products of one brand, then below of other ext. I'd like them do display all mixed together.
Thank you
I was wondering if there is a way to display products randomly at default "sort by" option. Right now it seems like it is chosen by date add. I have different brands, so at default settings I have all products of one brand, then below of other ext. I'd like them do display all mixed together.
Thank you
Try this:
1. EDIT: catalog/controller/product/catalog.php
2. FIND:
3. BEFORE, ADD:
1. EDIT: catalog/controller/product/catalog.php
2. FIND:
Code: Select all
$this->data['pagination'] = $pagination->render();
Code: Select all
shuffle($this->data['products']);
Hello, i've solved this problem after searching a lot on internet.
I put the following code:
Before this line:
As Qphoria have said.
What my code do?
My code test if the sort is seted(not null) or if it haves the main value ("p.sort_order"), if yes, it shuffle the products, if not it just follows the sort that was seted.
Try it out.
I put the following code:
Code: Select all
if ($this->request->get['sort'] == 'p.sort_order' || !isset($this->request->get['sort']))
{
shuffle($this->data['products']);
}
Code: Select all
$this->data['pagination'] = $pagination->render();
What my code do?
My code test if the sort is seted(not null) or if it haves the main value ("p.sort_order"), if yes, it shuffle the products, if not it just follows the sort that was seted.
Try it out.
Hi im interested in this feature........ can anyone say how this can be implemented in OC 2.0.3.1vinivst wrote:Hello, i've solved this problem after searching a lot on internet.
I put the following code:
Before this line:Code: Select all
if ($this->request->get['sort'] == 'p.sort_order' || !isset($this->request->get['sort'])) { shuffle($this->data['products']); }
As Qphoria have said.Code: Select all
$this->data['pagination'] = $pagination->render();
What my code do?
My code test if the sort is seted(not null) or if it haves the main value ("p.sort_order"), if yes, it shuffle the products, if not it just follows the sort that was seted.
Try it out.
Thanks
~Time
Who is online
Users browsing this forum: No registered users and 8 guests