Product Sort Order Within A Category
Hi,
I have read the Zen Cart info on default product sorting and have successfully implemented this on the New Product and All Products but cannot get this to work on the Product Listing.
I am looking to sort products by their date added, descending. As this is not an option in the Config-> Product Listing I am using the product model and have changed it from 0 to 6. When I then go to Display Product Listing Default Sort Order and set it to 6d, the sort order still stays as alphabetical, which it is now.
I am obviously missing something....can someone point me in the right direction??
Thank you in advance for your help.
Re: Product Sort Order Within A Category
This is how I do it,
includes/index_filters/default_filter.php
find the 2nd instance of
Code:
$listing_sql .= " ORDER BY p.products_sort_order, pd.products_name";
change to
Code:
$listing_sql .= " ORDER BY p.products_date_added desc, p.products_sort_order, pd.products_name";
I believe that the setting
Admin > configuration > product listing > Display Product Listing Default Sort Order
needs to be left blank for this to work.
Re: Product Sort Order Within A Category
Hi Simon,
Thanks for your help and reply! I'll give this a go later today and will let you know.
Thanks again!
Re: Product Sort Order Within A Category
Hi again Simon....your code change worked perfectly and I now have the products in each category being sorted by date added.
Thanks very much for your help!
Re: Product Sort Order Within A Category
Quote:
Originally Posted by
NWCE
Hi again Simon....your code change worked perfectly and I now have the products in each category being sorted by date added.
Thanks very much for your help!
Glad to help.