adyck Posted August 27, 2005 Posted August 27, 2005 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?
Guest Posted August 27, 2005 Posted August 27, 2005 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.
adyck Posted August 27, 2005 Author Posted August 27, 2005 Open file admin\categories.phpLocate 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. <{POST_SNAPBACK}> Sorry, but I have no idea how to modify this.
Guest Posted August 27, 2005 Posted August 27, 2005 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");
adyck Posted August 27, 2005 Author Posted August 27, 2005 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"); <{POST_SNAPBACK}> You are a genius. You have saved me so much work. Thank you.
Guest Posted September 4, 2005 Posted September 4, 2005 I just wanted to thank you also as I came here tonight to find out how to do this exact thing!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.