Yesterday, a new client approached me to ask if I could provide a way (in 2.3.1) to sort Product Options, and the Attributes of those Options. Well, it’s not rocket science to do this, so came up with a solution.
1. An easy way to sort Product Options
2. An easy way to sort the Attributes of those Options
3. An easy way to set an Pre-Selected Attribute.
How it works right now;
In standard 2.3.1 the Options are listed in alphabetical order, so in the example below, Memory comes above Model;
Then the attributes are listed with the lowest cost first, in the image below, you can plainly see that -$10 comes before $0 (blank). The already selected attribute is always the lowest cost (which may be undesirable);
1. Recode the admin/product_attributes screen to allow the shop owner to give a Sort Order to the Options;
2. Further recode the admin/product_attributes screen to allow the shop owner to give a Sort Order to the Attributes of each Option, per product (basically the same idea as the previous image, but for Attributes).
3. Recode the product_info.php to ensure that both the Options and their Attributes are sorted by the relevant sort_orders. Also make it so that any sort of zero will be the selected attribute…
Now, the Shop Owner can mix up his options and attributes as he pleases. In the example below, I set 3 versions: VHS (-$10), DVD, Blu Ray (+10). Previously, the -$10 VHS option would have been pre-selected. Now the DVD option is pre-selected, even though it is not first in the dropdown list.
and here is how I set it up in the admin screen;
Once I get this delivered to the client, he might want to contribute it to the osCommerce site, I do not know.