When someone clicks on a subcategory, for example toys-infant. It shows a list of all infant toys. They are in alphabetical order. I would like them to list in the order they were added to the store, so that the newest products come up first.
When someone clicks on a subcategory, for example toys-infant. It shows a list of all infant toys. They are in alphabetical order. I would like them to list in the order they were added to the store, so that the newest products come up first.
Currently, the Product Listing is sortable by the fields that you have selected to display ... unfortunately, date added is not one of them ...
You would have to customize the code to sort by date added then product name vs one of the available fields ...
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: v1.5.5]
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!
where would I look for the code that is doing the sorting?
Open the file [FONT="Courier New"]/includes/index_filters/default_filter.php[/FONT]
Find the line that says (line 113 in default 1.3.7):
Replace with:PHP Code:
$listing_sql .= ' order by ';
Go to Configuration -> Product Listing -> Display Product Listing Default Sort Order. Set this to anything valid, like "2a" for example. This isn't going to do anything, just activates the part of the code in default_filter.php file that does the sorting.PHP Code:
$listing_sql .= ' order by p.products_date_added DESC,';
that worked! Thanks. - Hunter
I want my most recent products showing first in the sort order on the listing display. This mod worked exactly as I wanted to get that to happen. Thank you.
Now for a follow up question: is anyone familiar with where I would change the code to do the exact same thing for the Previous/Next logic that cycles through the listing on the Product Info page?
I know that is set in the Config/Product Info/Previous Next - Sort Order where date added is not an option so I'm assuming I need to customize just like I did for the product listing page.
Thank you!
www.pinkchalkfabrics.com - cloth, pattern + tool for modern sewists
ZC version 1.3.9h, Simple Category Tree, Super Orders
Currently, in the Configuration ... Product Info ... there is a setting for:
You would have to customize the code further if you want it to sort by date vs any of the built in settings ...Previous Next - Sort Order
Products Display Order by
0= Product ID
1= Product Name
2= Model
3= Price, Product Name
4= Price, Model
5= Product Name, Model
6= Product Sort Order
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: v1.5.5]
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!
Thank you Ajeh. That's what I thought. Can you point me to the file that contains the Previous/Next SQL statement or what I would search for in order to find it myself?
Thank you!
Kathy
www.pinkchalkfabrics.com - cloth, pattern + tool for modern sewists
ZC version 1.3.9h, Simple Category Tree, Super Orders
Bookmarks