Contributions

Credit Modules (Category Index)
Search: 

Search Descriptions simple mod

I've looked everywhere in the forums last week to find out how to make quick search, search in descriptions. I've tried editing search.php in includes/boxes, and editing advanced_search.php. But the one thing that worked for me was posted by: Emmett Brosnan. Maybe its because my site is STS modified. Hope this helps someone.

File: advanced_search_result.php

Change:


CODE
default:
$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;


To:


CODE
default:
$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;


Expand All / Collapse All

Just added the php file gmltw 24 Mar 2007

Just added the php file to make it even easier. Also cleaned up the instructions a little.

This is a very quick and easy mod. Takes all of 30 seconds (depending on your net speed).

This works great if you want the quick find to search through the descriptions as well.

Thanks to those who originally posted the solution!
Emmett Brosnan and Gabin

gmltw

Search Descriptions simple mod Gabin 18 Jun 2006

Note: Contributions are used at own risk.