Community Add-Ons
| Maintainers: | Gabin |
Search Descriptions simple mod
for osCommerce Online Merchant v2.2
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;
Same principle, but uses an admin configuration to control whether or not to search descriptions by default instead of having the choice hard-coded.
