Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

sort order of option values?


whodah

Recommended Posts

hiya! i've searched, but my search terms keep on getting order table hits..

 

at anyrate, i'm importing data from a flatfile into oscommerce tables. i'm trying to determine the sorting order oscommerce does on 'Option Values'.

 

at first, i thought it was alphabetical. doesn't appear to be. then i thought perhaps by order it was entered into the db, i.e. products_options_values_id. but doesn't appear to be.

 

can anyone tell me what order they are sorted by? i.e. for the default install item number MG200MMS (Matrox G200 MMS), how does the 'memory' get sorted?

 

4 mb

8 mb (+$50.00)

16 mb (+$70.00)

 

thx!

Who Dah?

Link to comment
Share on other sites

so if i added literally:

 

a) blah blah +$4.79
b) blah blah +$36.78

 

then 'a)' comes before 'B)', right?

 

this isn't hapening :(

 

the 'b' option is showing up first!

 

[edit]had to use code tag[/edit]

Link to comment
Share on other sites

I believe there is no out of the box sort order in

 

catalog/product_info.php.....

 

So I change around line 138 to add sort by name as follows.

 

$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");

 

HTH

Tom

Link to comment
Share on other sites

heya!

 

stevel: cool! i iddn't see your post in time..

 

OceanRanch: not quite what i was after, but it got me on the right track! i was after sorting the products_options_values_name

 

2 lines below the line you mentioned, i tagged on at the end the order by as such:

 

// whodah modified the next line to sort by name 2004.05.12
   $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 = '" . (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");

 

thx!

-Who Dah?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...