Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

re-ordering product attributes


erikwoods

Recommended Posts

You're looking in the file product_info.php for the line that says:

tep_db_query function for $products_options at line 134

When you find it add this to the end of the line :

 

. "' order by products_options_values_name");

in place of the . "'"); that's there now

 

Try this, it should sort the drop down box by the name of the option value.

 

Jeremy

Link to comment
Share on other sites

Something's not right. In product_info.php the line you're talking about says

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

Is this the statement you were talking about?

If so, there are no empty quotes, and changing it from popt.products_options_name to popt.products_options_values_name did not work.

 

Any idears?

Link to comment
Share on other sites

It could be that the line number is incorrect. I've made changes to so many files, I've lost track of exactly what I've done. I'll look at an unchanged file and see, there could be a couple of similar bits of code right in that area if I remember correctly.

 

Jeremy

Link to comment
Share on other sites

Ok, looks like you changed line 131, which has an order by clause in it. Change that back to the original, which is ... (int)$languages_id . "' order by popt.products_options_name");

 

3 lines below that, this is the line I mean:

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

 

At the end of the line where it says $languages_id . "'"); you add in the order clause, like so: blahblahblah... $languages_id . "' order by products_options_values_name");

 

Try that,

Jeremy

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...