Attributes dropdown sorted by ID or manually but needs a alphanumeric default option

Description

The attributes in the catalog - dropdown are sorted by ID and can be resorted using Admin -> Catalog -> Product Attributes but this is a long and slow process when there are many attributes. eg 20 attributes with 200 products.

Use of Easypopulate overwrites all the sorting and it is lost and needs to be resorted each time.

Anyone selling clothing, shoes etc with sizing will want attributes sorted alphanumerically eg, 10a, 10b, 10c, 12a, 12b......

Forum link
http://www.oscmax.com/forums/store-administration/28019-sort-attributes-alphanumerically.html#post68844

Environment

None

Steps to reproduce

None

Activity

Show:
Giles Marshall
April 26, 2012, 2:37 AM

catalog/includes/classes/pad_base.php

Line 408:
order by popt.products_options_sort_order, popt.products_options_name

Would appear that this should be sorting by sort_order then products_options_name which should mean alphanumerically.

Edit: Just tested this and the sort does not seem to work.

Steve
April 26, 2012, 2:49 AM

Here is a link to my site showing the issue,

http://www.downunderwear.co.nz/product_info.php?products_id=32

I have fixed the problem short term using phpadmin to manipulate the data so it no longer shows on the live site.

Giles Marshall
April 26, 2012, 5:52 PM

It looks like the second query on line 413 needs another "order by"

$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$this->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 pa.products_options_sort_order, pa.options_values_price");

Should be able to add pov.products_options_values_name before pa.options_values_price in order by.

Steve
April 26, 2012, 9:04 PM

Thanks pgmarshall for that fix.

I used it in my localhost installation and it work perfectly so I will now use it on the live site.

Regards

Steve

Giles Marshall
April 27, 2012, 2:44 AM
Done

Assignee

Giles Marshall

Reporter

Steve

Labels

None

Severity

Tweak

Components

Fix versions

Affects versions

Priority

Configure