View Single Post
  #128  
Old 05-22-2005, 04:09 PM
 
mikebo mikebo is offline
 

Advanced Member
  
Join Date: Feb 2004
Location: Ohio
Posts: 72
 

Default

To get the search to pick up product codes (sku's) in my 4.0.13 store where I do not use the full description field, I did a search and replace with my text editor in the following files:

search.php
include/search.php
skin1/customer/search.tpl

I replaced "fulldescr" with "productcode". This seems to work great for picking up the product code.

To get the s's stripped from the search term, I revised funkydunk's original code a bit.

In the 4.0.13 include/search.php file,

I replaced this

Code:
$data["substring"] = trim($data["substring"]);


with this

Code:
$data["substring"] = trim($data["substring"]); // code to strip last s from search string $start = (strlen($data["substring"])-1); // echo $start; // echo " "; if ((substr($data["substring"],$start,1)=="s")||(substr($data["substring"],$start,1)=="S")){ $data["substring"] = substr($data["substring"],0,$start); // echo $substring; } // end of code to strip last s from search string


This seems to work fine.

Hope this helps.
__________________
Mike
X-Cart Gold
Version 4.6.0 PHP 5.2.17
Reply With Quote