Forums / Setting Up Categories, Products, Attributes / Sort order of option values

Sort order of option values

Views: 873

Results 1 to 4 of 4
17 Apr 2013, 10:53 PM
#1
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Sort order of option values

Hi I have a set of attributes which are sorted like this:

Option Value 1 Sort Order 0
Option Value 2 Sort Order 1
Option Value 3 Sort Order 2
Option Value 4 Sort Order 3
Option Value 5 Sort Order 4

Now I'm aware I've made a stupid error here as of course they should have been sorted like this:

Option Value 1 Sort Order 10
Option Value 2 Sort Order 20
Option Value 3 Sort Order 30
Option Value 4 Sort Order 40
Option Value 5 Sort Order 50

However I now have a dilemma as I need to add a new option value above Option Value 1 Sort Order 0 and I have numerous products with this set up, too many to go through 1 by 1.

The option value that should go above Option Value 1 Sort Order 0 will be NONE Sort Order -1, I can set this up in Option Values Manager and then add this to all products with the associated Option Name but it defaults back to Sort Order 0 and doesn't apply the new option value in as Sort Order -1. That would mean I would have to go through every product that has the associated Option Names and Option Values and manually change the new NONE option value to -1 through the attributes controller.

So I need a way to either a) fix the sort order so it could be
Option Value NONE Sort Order 0
Option Value 1 Sort Order 10
Option Value 2 Sort Order 20
Option Value 3 Sort Order 30
Option Value 4 Sort Order 40
Option Value 5 Sort Order 50

Or add Option Value NONE Sort Order -1 to all products with the associated Option Name. I don't mind if this has to be done through the database either. I'm sure it must be a common problem.

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

17 Apr 2013, 10:56 PM
#2
ajeh avatar

ajeh

Oba-san

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

Re: Sort order of option values

Go to the Catalog ... Option Value Sorter ... and set the Values you want to have ...

Once set, you can run the:

Update All Products' Attribute Sort Orders
to match Option Value Default Sort Orders:

And this will fix ALL Attributes for ALL Products with the Default Sort Orders on ALL Option Values ...

NOTE: Backup your database before using this ...

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!

17 Apr 2013, 11:59 PM
#3
nick1973 avatar

nick1973

Totally Zenned

Join Date:
Sep 2008
Location:
Cleethorpes
Posts:
1,230
Plugin Contributions:
3

Re: Sort order of option values

Ajeh:

Go to the Catalog ... Option Value Sorter ... and set the Values you want to have ...

Once set, you can run the:

And this will fix ALL Attributes for ALL Products with the Default Sort Orders on ALL Option Values ...

NOTE: Backup your database before using this ...

Thanks Linda, never used that so wasn't to know. Will save lots of time!!!!:D

Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk

18 Apr 2013, 1:06 PM
#4
ajeh avatar

ajeh

Oba-san

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

Re: Sort order of option values

You are most welcome ... thanks for the update that this was able to work for you to fix your Option Values Sort Order ... :smile:

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!