Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

osc234 w/ Bootstrap how to set in admin prod name descending


dculley

Recommended Posts

How do you set the product name to descending?  At the moment, product name is it not in any kind of order and it jumps around when you click on one line, before you can click on edit.  The order is forever changing.  Would like to lock this down.

 

I just do not know where to set it? 

 

In the standard osc234 the product names are descending and do not jump around. 

 

Dean

Link to comment
Share on other sites

This is the standard query in Admin\categories.php

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
    } else {
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

You will see that the default sort order is by name (ascending). Add DESC so that you have:

$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name DESC");
    } else {
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name DESC");
Link to comment
Share on other sites

@@Hotclutch

 

Hi Ashley,  I checked my line codes in admin/categories and they already have "desc" at the end.  Seems to behaving no effect. 

 

I did try and find an add-on but no luck there. 

Link to comment
Share on other sites

@@Hotclutch

 

Think I hit a home run :lol:

 

I don't give up easy.  Saw the missing bit and fixed it at the end,  also removed DESC from the end.  DESC put it in z to a mode.  Leaving it off put it in a to z mode. 

 

Thank you very much.

Dean

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...