PDA

View Full Version : [Products/Categories] Sort attributes alphanumerically



Stevell
04-24-2012, 04:23 AM
Hi
Is there an option to sort product attributes alphanumerically? I have searched forums etc but I don't see anything.

I have 200 products with 17 attributes each. I have imported them using Easypopulate but it has changed their order.

Am I missing an option somewhere?

Thanks Steve

ridexbuilder
04-24-2012, 09:23 AM
Hi
Is there an option to sort product attributes alphanumerically? I have searched forums etc but I don't see anything.

I have 200 products with 17 attributes each. I have imported them using Easypopulate but it has changed their order.

Am I missing an option somewhere?

Thanks Steve

This has been identified as an issue and I've made one poor attempt to resolve. To me this is an important fundamental issue, unlike some of the 'stuff' that has been addressed/posted to the forum/added to bugtracker recently. I've almost found the heart/impetus to take another look.
EJ

pgmarshall
04-24-2012, 01:16 PM
Are you talking about Product Attributes or Product Options? If it is really Product Attributes then it works now!

Ie. If you are talking about the order in which the options are displayed in the drop down then this works ... just doubled checked it.

You can set the sort order in the Admin -> Catalog -> Product Attributes ... although I think the best place to do it is in the product screen (categories.php).

However, if you are talking about the order in which the drop down boxes are displayed then this is on the to do list.

Regards.

Stevell
04-24-2012, 07:38 PM
I was talking about the order in which the options are displayed in the dropdown. I could move them all up and down into order in Admin -> Catalog -> Product Attributes but it would take 30 hours plus to do something I was hoping would be quite simple to change/ turn on.

The attributes I am sorting are sizes, 8A, 8B, 8C, 8D, 8E, 8F, 8G, 10A, 10B, 10C........

I just want them all in order so it is logical to the customers.

Thanks Steve

Stevell
04-24-2012, 08:20 PM
Are you talking about Product Attributes or Product Options? If it is really Product Attributes then it works now!

Ie. If you are talking about the order in which the options are displayed in the drop down then this works ... just doubled checked it.

You can set the sort order in the Admin -> Catalog -> Product Attributes ... although I think the best place to do it is in the product screen (categories.php).

However, if you are talking about the order in which the drop down boxes are displayed then this is on the to do list.

Regards.

I was talking about the order in which the options are displayed in the dropdown. I could move them all up and down into order in Admin -> Catalog -> Product Attributes but it would take 30 hours plus to do something I was hoping would be quite simple to change/ turn on.

The attributes I am sorting are sizes, 8A, 8B, 8C, 8D, 8E, 8F, 8G, 10A, 10B, 10C........

I just want them all in order so it is logical to the customers.

Thanks Steve

pgmarshall
04-24-2012, 10:35 PM
Check the bug tracker ... if this is not listed then please add it as a new one with a link to this thread and I will take a look.

In the meantime you could simply sort the table in phpMyAdmin or similar as I believe it sorts them by the order they were entered

Regards.

niallb
04-25-2012, 04:57 AM
I was talking about the order in which the options are displayed in the dropdown. I could move them all up and down into order in Admin -> Catalog -> Product Attributes but it would take 30 hours plus to do something I was hoping would be quite simple to change/ turn on.

The attributes I am sorting are sizes, 8A, 8B, 8C, 8D, 8E, 8F, 8G, 10A, 10B, 10C........

I just want them all in order so it is logical to the customers.

Thanks Steve

Hi,
they are already in alphanumeric order on the dropdown. A problem you may have is that it will show size 10, 12 etc before sizes 6 and 8 as it goes by the 1st number shown and 1 comes before 6 or 8. You can get round this by numbering them 06, 08, 10, 12 etc.
Niall

DanDan
05-10-2012, 01:34 PM
Actually they are not in alphanumeric order in the dropdown, they are in random order. I have been trying to solve the same problem. I looked at some oscommerce solutions and found the way oscommerce solved it;

Sort alphabetically (from oscommerce):

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix, pa.products_attributes_id from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'" . " order by pov.products_options_values_name");

I tried to adapt the method to the product_info.tpl.php page where the following code appears:

$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$_GET['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);


I tried to add . "'" . " order by pov.products_options_values_name"); to the end of (int)$languages_id . "'"); changing pov to povt but could not get it to work. Maybe someone with more knowledge of PHP could make this work.

Dan

pgmarshall
05-10-2012, 01:53 PM
0001195: Attributes dropdown sorted by ID or manually but needs a alphanumeric default option - osCmax Bug Tracking System (http://bugtrack.oscmax.com/view.php?id=1195)

niallb
05-11-2012, 02:48 AM
Actually they are not in alphanumeric order in the dropdown, they are in random order.

Thats odd, I only have sizes on 1 of my sites, admittedly using v2.0.25 not v2.5.1, and all the clothes sizes are alphanumeric in the dropdown menu.

Rogar
07-07-2012, 05:28 PM
In my store I use the attributes drop down alot and each attributes has a price associated to them and the default being at a price of 0.

Prior to this update it would sort by price, now it is sorted by alphabet, my product prices are all over the place as it is defaulting attributes customer might not want.

Is there a way to change this easily (at the moment I've just removed the code as I have LOTS of attributes).

Thanks.

pgmarshall
07-13-2012, 10:16 AM
Rogar - just undo the change made here: 0001195: Attributes dropdown sorted by ID or manually but needs a alphanumeric default option - osCmax Bug Tracking System (http://bugtrack.oscmax.com/view.php?id=1195)

Regards.

Rogar
07-13-2012, 01:15 PM
Hi pgmarshall,

Yeah that's what I did, I just wasn't sure whether that was over kill and I was missing a config setting or something!

pgmarshall
07-13-2012, 01:26 PM
It probably should be a config setting! Does it work for you now?

Regards,

Rogar
07-14-2012, 02:01 PM
Yes, it works fine. A config option would be the best way forward I think, as there are two ways people can use the attributes options.

1) Same price but different sizes
2) An attribute has a different price.