Community Add-Ons

Maintainers: Gabin
Add file to this package
Top » Credit Modules

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;


Legend:  Download   Report

Expand All / Collapse All

Admin config version amseek 13 Nov 2009  

Same principle, but uses an admin configuration to control whether or not to search descriptions by default instead of having the choice hard-coded.

Just added the php file gmltw 24 Mar 2007  
Search Descriptions simple mod Gabin 18 Jun 2006