Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Arrange Products Attribute:Option Value


graphicore

Recommended Posts

How can I arrange the option value displayed on the item version rollover menu????? or can I swap columns on mySQL?????

 

Please I need help asap since the default (first) option should be downloadable on my versions selection but it's showing another option instead.

Link to comment
Share on other sites

it shows the option eneterd first by default.

so delecte the entire option, that now shows first, and re-ad that.

 

so not just in articles option per product, but the option itself.

the mysql query could also be edited, but that will require modification to the php code.

Link to comment
Share on other sites

it shows the option eneterd first by default.

so delecte the entire option, that now shows first, and re-ad that.

 

so not just in articles option per product, but the option itself.

the mysql query could also be edited, but that will require modification to the php code.

 

That's not true... I create them in order and they show up in my admin page in the right order .... but they show differently on the live page.

Link to comment
Share on other sites

by default the osc code does not give an order by statement on that part of the code.

you can insert it, change in product_info.php

	  $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 . "'");

to

	  $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");

it will now order by name.

 

Once again, the order is not set by default, this has absolutely nothing to do with any product this atribute option is assigned to, it is the order the atribute options are entered that by default sets the order in wich atribute options are shown.

 

I wrote code for others to order the options by price before, this is what I personaly use.

 

edit:typo

Link to comment
Share on other sites

by default the osc code does not give an order by statement on that part of the code.

you can insert it, change in product_info.php

	  $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 . "'");

to

	  $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");

it will now order by name.

 

Once again, the order is not set by default, this has absolutely nothing to do with any product this atribute option is assigned to, it is the order the atribute options are entered that by default sets the order in wich atribute options are shown.

 

I wrote code for others to order the options by price before, this is what I personaly use.

 

edit:typo

Thanks for the hint. I'll give it a try.

The issue here is that I entered them in the right sequence. The id's asigned are even in the right sequence, but they still show differently to be choosen.

 

osc_issue.jpg

Link to comment
Share on other sites

$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");

 

cept this is the code for product options names ie size or colour not option values ie red, blue, green or small medium, large which i think graphicore is talking about. options values r not ordered by default yes and will appear in seemingly random order on ur live page.

 

if u want to order the option values on ur live page in the same sequence that they r in ur admin change the following code

 

$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 . "'");

to

 

$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 pa.options_values_id asc"); //order by option values asc

Link to comment
Share on other sites

oops that should be:

 

$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_id"); //order by option values id

hope that works :-"

Link to comment
Share on other sites

oops that should be:

 

$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_id"); //order by option values id

hope that works :-"

 

Sweet!... That did it. Thanks a lot. Really appreciated. I knew somebody knew this thing. :thumbsup:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...