Forums / Templates, Stylesheets, Page Layout / Can you sort products by their ID (the order you enter them)

Can you sort products by their ID (the order you enter them)

Locked

Started by amdowney on 31 May 2007, 12:43 PM · Views: 1,385

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
31 May 2007, 12:43 PM
#1
amdowney avatar

amdowney

New Zenner

Join Date:
Nov 2006
Posts:
30
Plugin Contributions:
0

Can you sort products by their ID (the order you enter them)

I know under Configuration > Product Listing > Display Product Listing Default Sort Order

you can enter 3c to sort by price, is there an entry to sort by ID (The order I enter the products in)?

Thanks in advance:bigups:

31 May 2007, 2:12 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can you sort products by their ID (the order you enter them)

Might peek in the Configuration ... Product Listing ...

Display Product Listing Default Sort Order
Product Listing Default sort order?
NOTE: Leave Blank for Product Sort Order. Sort the Product Listing in the order you wish for the default display to start in to get the sort order setting. Example: 2a

This will provide the listing by the physical sort order you enter for the products ...

This allows you to be specific about the order of your products ...

While you could use the products_id by altering code, you will find later entering a new product would throw it out of order ...

If your current order is correct, you could update the products_sort_order by the products_id * 10 which would then set the value to 10 x the products_id ... this allows you to later add new products and enter them between old products ...

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!

31 May 2007, 2:26 PM
#3
amdowney avatar

amdowney

New Zenner

Join Date:
Nov 2006
Posts:
30
Plugin Contributions:
0

Re: Can you sort products by their ID (the order you enter them)

By doing this directly in the mysql database?

update products set sort_order = ( products_id * 10)

What is the correct SQL to do this for every entry?

31 May 2007, 2:27 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Can you sort products by their ID (the order you enter them)

You could use:

UPDATE products SET products_sort_order = products_id * 10;

This would change all Products to have a products_sort_order of 10 times their products_id ...

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!