How to modify "default" Search Options from "Any of these words" to "All of these words" in 2.x

I searched the forums for an option to have the default search option set on “All of these words” in cs-cart 2.1.x without success.



The default setting of “Any of these words” is crappy and makes the Search useless.



For example, if i'm using a word in the search field and click on Search i get too many results. It seems that the scripts also looks in product description, etc and thus the result list has all sort of products totally unrelated to my search.



I want to search to “look” only in the product name and take in account all words (if i'm using more then one).



Shortly, now, if i click on Advanced Search, the default option listed is “Any of these words”. How can i change that to “All of these words”.



Thanks

Hello,



ADMIN:

change on file [color=#ff0000]skins/basic/admin/views/products/components/products_search_form.tpl[/color] line 31





with:







CUSTOMER:

on file s[color=#b22222]kins/basic/customer/blocks/search.tpl[/color] on line 3 under

```php


```
add
```php

```

for trhe search prom products.search
on file [color=#ff0000]skins/basic/customer/views/products/components/products_search_form.tpl [/color][color=#000000]on line 18[/color] replace
```php

{$lang.any_words}
{$lang.all_words}
{$lang.exact_phrase}

```
with
```php

{$lang.all_words}
{$lang.any_words}
{$lang.exact_phrase}

```

I hope this information will help you.

---
Vali

Anyone know how to this in version 4, and which files to edit?

Figured it out:



To set quick search to search by “all of these words” in 4.0.1:


  1. Open the file: /app/functions/fn.catalog.php


  2. In this file add the following code:





if (empty($params['match'])) {
$params['match'] = 'all';
}




above this one:



[color=#33CC00]// Search string condition for SQL query[/color]



Save the file, and replace the one on your server with the new one.



ALWAYS remember to backup.

Thanks



Thanks worked great.



I want to only search the Search Words box. Or at least stop it from searching the descriptions. Is there a way to do this?

bump.



I would also like to know how to stop searching in descriptions