Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tweek 'quick find' to search descriptions


breezy

Recommended Posts

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

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

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

  • 9 months later...

Archived

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

×
×
  • Create New...