I have been searching through this forum for days and can't seem to find a solution to this problem.
On my category page, it appears that products are being displayed from Oldest-to-Newest in the default. I made some changes in controller/product/category.php and model/cataloq/product.php by changing where i see ASC to DESC BUT it is still being sorted in oldest-to-newest
How do i make the default order sort from Newest-to-oldest on the Category page? My version is 1.4.9.1
Thank You
On my category page, it appears that products are being displayed from Oldest-to-Newest in the default. I made some changes in controller/product/category.php and model/cataloq/product.php by changing where i see ASC to DESC BUT it is still being sorted in oldest-to-newest
How do i make the default order sort from Newest-to-oldest on the Category page? My version is 1.4.9.1
Thank You
NOTE: This has not been tested!
Open
Find
and change it to
Then open
Find the FIRST instance of
and change it to
Open
Code: Select all
/catalog/controller/product/category.php
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.sort_order';
}
Code: Select all
if (isset($this->request->get['sort'])) {
$sort = $this->request->get['sort'];
} else {
$sort = 'p.product_id';
}
Code: Select all
/catalog/model/catalog/product.php
Code: Select all
$sort_data = array(
'pd.name',
'p.sort_order',
'special',
'rating',
'p.price',
'p.model'
);
Code: Select all
$sort_data = array(
'pd.name',
'p.sort_order',
'special',
'rating',
'p.price',
'p.product_id',
'p.model'
);
Thanks for the solution, I have done in an alternative way:
open
find the funciton getProductsByCategoryId
Since the "default" sort order is p.sort_order, we can simply use a conditional tag to find out this instance and construct the sql to
open
Code: Select all
/catalog/model/catalog/product.php
Since the "default" sort order is p.sort_order, we can simply use a conditional tag to find out this instance and construct the sql to
Code: Select all
$sql .= " ORDER BY p.product_id DESC" ;
Who is online
Users browsing this forum: Amazon [Bot] and 19 guests