Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Attribute sorting


kuzz

Recommended Posts

Hello,

 

I'm just looking for some help in sorting the lists for my product's attributes, like colors, sizes, etc. in alpha or numerical order. I've gone through some contributions such as Product Attribute Sort 1.2 but it doesn't work well and is very tedious. Can anyone make any recommendations on a good way to sort these? I've skimmed through the forum and contributions but there is so much information it's taking me hours and nothing helps. I appreciate any information, thanks.

 

Joel

Link to comment
Share on other sites

Here's a very quick fix - don't know if it'll help you - but it has done me!

 

The random options is because there is no sort in the default query so you are at the mercy of MYSQL. No guarantee of any sort sequence.

 

To sort by the "options_value_id" field add the sort field to the query in catalog/product_info.php

 

Change This

 

$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)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'");

 

to this:

 

$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)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "' order by pa.options_values_id");

===============

Simple yet Creative

Get Online Web Design : getonlinedesign.com

===============

Link to comment
Share on other sites

Joel

 

Can you clarify what is out of order - is it in the admin section or on the actual page - can you give us a URL as an example?

 

Thanks

 

Jos

===============

Simple yet Creative

Get Online Web Design : getonlinedesign.com

===============

Link to comment
Share on other sites

Of course, if you goto:http://www.chefscloset.com/catalog/product_info.php?cPath=21&products_id=29

look at the size, I want it to be, XS, S, M, etc, instead it's the complete opposite.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...