View Single Post
Old 03-06-2003, 01:55 AM
funkydunk funkydunk is offline

Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210

Default Search Modification

Just a simple work around for when a customer searches for say laptops and you have loads of product defined as laptop computer. In this instance nothing would show in the results.

This strips the s of the end for the search:

Add into customer/search.php below the:

# Perform SQL search query

if(!$substring) { $substring = $substring_sku; }


// code to strip last s from search string $substring = trim($substring); $start = (strlen($substring)-1); if ((substr($substring,$start,1)=="s")||(substr($substring,$start,1)=="S")){ $substring = substr($substring,0,$start); }

the searches for laptops will show up anything that is a laptop

Obviously it doesn't only work for laptops
ex x-cart guru
Reply With Quote