I would like that my products is sorted by date. The newest product should appear first.
Did you have some suggestions?
I would like that my products is sorted by date. The newest product should appear first.
Did you have some suggestions?
I love internet and the power of information... Best Wishes!!
Your options are at
admin > config > layout settings > Categories/Products Display Sort Order
Zen-Venom Get Bitten
There isn't any option to sort by date, only by name, quantity and price.
I love internet and the power of information... Best Wishes!!
I would like to do this too, my products seem to do what they want... sometimes its by sort order, sometimes not. Date added would be much nicer.
Hey, so what's the answer? How to sort by date? NEed help too..
There are a number of places where the Products are listed ...
Could you give more details on where you are trying to get Products listed by date?![]()
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
You would need to change the:
$order_str
in the file:
/includes/modules/pages/advanced_search_results/header_php.php
most likely around line 454:
Code:$listing_sql = $select_str . $from_str . $where_str . $order_str;
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Thanks the reply.
I found out the code in header_php.php, but i don't know where to put the code or change the $order_str with "p.products_date_added"
I try to put it everywhere but then error happened
Please check the code there:
Could you help me?Code:// if set to nothing use products_sort_order and PRODUCTS_LIST_NAME is off if (PRODUCT_LISTING_DEFAULT_SORT_ORDER == '') { $_GET['sort'] = '20a'; } } else { $sort_col = substr($_GET['sort'], 0 , 1); $sort_order = substr($_GET['sort'], 1); $order_str = ' order by '; switch ($column_list[$sort_col-1]) { case 'PRODUCT_LIST_MODEL': $order_str .= "p.products_model " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; break; case 'PRODUCT_LIST_NAME': $order_str .= "pd.products_name " . ($sort_order == 'd' ? "desc" : ""); break; case 'PRODUCT_LIST_MANUFACTURER': $order_str .= "m.manufacturers_name " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; break; case 'PRODUCT_LIST_QUANTITY': $order_str .= "p.products_quantity " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; break; case 'PRODUCT_LIST_IMAGE': $order_str .= "pd.products_name"; break; case 'PRODUCT_LIST_WEIGHT': $order_str .= "p.products_weight " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; break; case 'PRODUCT_LIST_PRICE': // $order_str .= "final_price " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; $order_str .= "p.products_price_sorter " . ($sort_order == 'd' ? "desc" : "") . ", pd.products_name"; break; } } $listing_sql = $select_str . $from_str . $where_str . $order_str; // Notifier Point $zco_notifier->notify('NOTIFY_SEARCH_ORDERBY_STRING', $listing_sql);
Have a nice christmas!
--Schumi
The sort order is defined by the contents of the:
$order_str
If you want the display order to be different than any of the existing sort orders, you can change its content before that line so it contains an ORDER BY statement to match your needs ...
Something like adding the line in red:
Code:$order_str = " ORDER BY p.products_date_added DESC, pd.products_name "; $listing_sql = $select_str . $from_str . $where_str . $order_str;
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!