Guest Posted October 26, 2003 Posted October 26, 2003 To add products where the keywords match the option value name to the search results: Around line 213 of advanced_search_result.php, change $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c"; to $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_ATTRIBUTES . " pa left join " . TABLE_PRODUCTS_OPTIONS _VALUES . " pov on pa.options_values_id=pov.products_options_values_id, " . TABL E_PRODUCTS_TO_CATEGORIES . " p2c"; Around line 223, change $where_str = " where p.products_status = '1' and p.products_id = pd.products _id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.pr oducts_id and p2c.categories_id = c.categories_id "; to $where_str = " where p.products_status = '1' and p.products_id = pd.products _id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.pr oducts_id and p2c.categories_id = c.categories_id and pa.products_id=p.products_ id "; Around lines 258, change $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufactur ers_name like '%" . tep_db_input($keyword) . "%'"; to $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufactur ers_name like '%" . tep_db_input($keyword) . "%' or pov.products_options_values_ name like '%" . tep_db_input($keyword) . "%'"; Hth, Matt
einshoej Posted November 1, 2011 Posted November 1, 2011 I have implemented the below mod, and it works very well - however it makes the search very slow - both advanced searches and quick searches from the search box. Can anyone help me get the option box "search in description" included in the code to make it possible to exclude the large search by unticking the option box. An other or even better oppotunity would be to add an extra option box to make "search in option fields" optional as well - in that way both you could still make a fast search in the descriptions without the option fiels. I hope someone can help me out here and I hope this request is posted in the correct way.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.