breezy Posted August 22, 2006 Share Posted August 22, 2006 can I change the 'quick find' to search descriptions? It seems to be only searching product titles, is this true or is there a place to assign keywords to associate with the products that the 'quick find' can actually find? Thanks! Link to comment Share on other sites More sharing options...
hack4lk Posted August 22, 2006 Share Posted August 22, 2006 try this contributions... http://www.oscommerce.com/community/contri...cription/page,2 Link to comment Share on other sites More sharing options...
Iggy Posted August 22, 2006 Share Posted August 22, 2006 can I change the 'quick find' to search descriptions? It seems to be only searching product titles, is this true or is there a place to assign keywords to associate with the products that the 'quick find' can actually find? Thanks! Hrrm, found this a long-time ago on the forums and have been using it ever since. Pretty simple. This is around line 314 or so in my advanced_search_result.php. You really only need the bit from the comment down. Commented lines at the end are the original code. if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'"; } if (isset($search_keywords) && (sizeof($search_keywords) > 0)) { $where_str .= " and ("; for ($i=0, $n=sizeof($search_keywords); $i<$n; $i++ ) { switch ($search_keywords[$i]) { case '(': case ')': case 'and': case 'or': $where_str .= " " . $search_keywords[$i] . " "; break; default: // Modified for search in description $keyword = tep_db_prepare_input($search_keywords[$i]); $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%' or pd.products_description like '%" . tep_db_input($keyword) . "%'"; if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'"; $where_str .= ')'; break; // $keyword = tep_db_prepare_input($search_keywords[$i]); // $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'"; // if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'"; // $where_str .= ')'; // break; HTH, Iggy Everything's funny but nothing's a joke... Link to comment Share on other sites More sharing options...
breezy Posted August 23, 2006 Author Share Posted August 23, 2006 can I change the 'quick find' to search descriptions? It seems to be only searching product titles, is this true or is there a place to assign keywords to associate with the products that the 'quick find' can actually find? Thanks! Thanks, I will look at those options! Link to comment Share on other sites More sharing options...
stargirlnine Posted May 25, 2007 Share Posted May 25, 2007 Iggy, that code change works awesome, thanks!!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.