Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

product atributes


xlilo

Recommended Posts

Hi all,

 

i have been adding diffrent product types in my data recovery, is there a way to set a default action? it seems to pic the most expensive option available when the page loads up when i need it to be the cheapest option.

 

this is the page : http://shop.xlilo.co.uk/product_info.php?products_id=28

 

it pics the +£30 option as default, i realy need it to be the minimum charge option for default.

 

Thanks

 

xlilo

Link to comment
Share on other sites

it pics the option added first as default.

you can change this by setting it to order by name for example.

in product_info.php look for this line:

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

and in order to let it order by name change that 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 pov.products_options_values_name ASC");

but you could change that to whatever you want.

for options price that would be a bit harder, since it is an abolute value, negative equeals positive, but you could still order by price correctly:

		$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.price_prefix ASC, pa.options_values_price ASC");

change the last two ASC to DESC if you please.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...