Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Default sorting question


forevergalleries

Recommended Posts

Not sure if this is already something in the plan...but

 

It would be nice if the osCommerce framework included the ability to change the default sorts for things like the categories and the product attributes.

 

As a side note if anyone wants to change these defaults and doesn't know how they can contact me or just read the diffs below.

 

[root@figment catalog]# diff product_info.php product_info.php.old

131c131

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

---

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

134c134

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

---

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

 

[root@figment catalog]# diff index.php index.php.old

193c193

< if ($column_list[$i] == 'PRODUCT_LIST_PRICE') {

---

> if ($column_list[$i] == 'PRODUCT_LIST_NAME') {

195c195

< $listing_sql .= " order by final_price";

---

> $listing_sql .= " order by pd.products_name";

 

 

 

If this is the wrong way to go about it I would appreciate a tap to let me know.

 

Thanks

-Chris

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...