Portal Home > Knowledgebase > Articles Database > Help make set minimum character for OSCommerce search, example set for 4 character


Help make set minimum character for OSCommerce search, example set for 4 character




Posted by basketmen, 07-11-2009, 04:50 AM
Hi guys, below is default OSCommerce complete search file, the file name is advanced_search_result.php oscommerce is very free famous script, but.. ironically this file is searching all words that typed by user, even just a single word like "A" or "An" it is searching in mysql, so its make very very high load for the server, imagine its need to search for all words that contain "A", how if you have 100.000 products/items in your site maybe the best option to reduce the load server is to set the minimum character to search, example to search only minimum 4 or more character, there is no setting for doing this in oscommerce setting, so its need to change some code in a file, i had asking this in oscommerce forum, but they cant do this http://forums.oscommerce.com/index.php?showtopic=340368 i think the part need to edit is in bold below, please help guys to make it only search 4 or more character words here is advanced_search_result.php file content : I had try change to red below, but no one working or or

Posted by foobic, 07-12-2009, 10:29 PM
Don't mess with the bit where it's creating a where clause (looks nasty!). Instead write a test to go earlier in the script - before "if ($error == true)". Something like this (untested): You'll also need to define the new error message ERROR_TOO_SHORT_KEYWORD in one of your language files.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
softhosts.com (Views: 677)
Iweb.ca Network Issues (Views: 706)
Who should I go for ? (Views: 634)
RVSiteBuilder Down? (Views: 671)

Language: