
Hi there, I have searched and tried a few things in order to set a default product sort view. I would like to have my products always sorted by "Model" ascending due to the way that I setup my products. Where do I need to set that exactly? See image attached. I am running OC v3.0.3.8 on stock theme. I have tried I have tried to set $sql .= " ORDER BY p.sort_order"; to $sql .= " ORDER BY p.model" cleared all cache but that had no effect.


Hi.
admin/controller/catalog/product.php function getList()
find (on line 258):
replace to:
admin/controller/catalog/product.php function getList()
find (on line 258):
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'pd.name';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.model';
}
if (isset($this->request->get['order'])) {
$order = $this->request->get['order'];
} else {
$order = 'ASC';
}
My FREE extensions in marketplace. [ security | flexibility | speedup ]
Hi there, unfortunately this is not what my line 258 looks like here is what I have.halfhope wrote: ↑Tue Feb 22, 2022 2:38 pmHi.
admin/controller/catalog/product.php function getList()
find (on line 258):replace to:Code: Select all
if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'pd.name'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; }
Code: Select all
if (isset($this->request->get['sort'])) { $sort = $this->request->get['sort']; } else { $sort = 'p.model'; } if (isset($this->request->get['order'])) { $order = $this->request->get['order']; } else { $order = 'ASC'; }

Hi. Look for the code throughout the document. I already wrote that the desired code in the getList function.
My FREE extensions in marketplace. [ security | flexibility | speedup ]
File admin/controller/catalog/product.php IS NOT catalog/model/product/product.php
"Do good and run"
"Do good and run"
My FREE extensions in marketplace. [ security | flexibility | speedup ]
Who is online
Users browsing this forum: Amazon [Bot] and 99 guests