Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

catalog search


adyck

Recommended Posts

Posted

When in Catalog Admin, it appears that I am not able to search by model number in keywords. Does anyone know if one can add this feature?

Posted

Open file admin\categories.php

Locate the search query should be a line like this somewhere in the file:

    if (isset($HTTP_GET_VARS['search'])) {

 

following this line should be the query you want to modify for the model.

Posted
Open file admin\categories.php

Locate the search query should be a line like this somewhere in the file:

    if (isset($HTTP_GET_VARS['search'])) {

 

following this line should be the query you want to modify for the model.

 

Sorry, but I have no idea how to modify this.

Posted

Do a backup of the original file before anything else.

 

Ok just below the line I mentioned earlier you should have this line:

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

 

Replace it with this line

 ? ? ?$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) . "%' OR p.products_model LIKE '%" . tep_db_input($search) . "%') order by pd.products_name");

Posted
Do a backup of the original file before anything else.

 

Ok just below the line I mentioned earlier you should have this line:

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

 

Replace it with this line

      $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) . "%' OR p.products_model LIKE '%" . tep_db_input($search) . "%') order by pd.products_name");

 

 

You are a genius. You have saved me so much work. Thank you.

Posted

I just wanted to thank you also as I came here tonight to find out how to do this exact thing!

Archived

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

×
×
  • Create New...