Zen Cart Logo
Forums / Basic Configuration / Can I customize the search facility to exclude descriptions?

Can I customize the search facility to exclude descriptions?

Locked

Views: 2,445

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
17 Nov 2008, 11:42 PM
#1
bonny avatar

bonny

New Zenner

Join Date:
Nov 2008
Posts:
3
Plugin Contributions:
0

Can I customize the search facility to exclude descriptions?

Can anybody please tell me how to customize my search facility so that the quick search results show only hits from the product title and the product attributes, excluding the product description.

Thanks in advance.

18 Nov 2008, 4:00 AM
#2
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

Re: Can I customize the search facility to exclude descriptions?

I do not believe product_attributes is used in the search. However, if you know how to program you can look in the search code and modify the code so that product_description is not used.

I believe this is the file to modify

/public_html/includes/languages/english/advanced_search_result.php

18 Nov 2008, 4:09 AM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can I customize the search facility to exclude descriptions?

Um, no, you won't find it in a language file.

To tell the search not to use the description, simply set the right parameter: Use the Developers Toolkit and search the catalog-side template files for search_in_description = 1 and change it to 0 instead of 1 in the appropriate file ... typically either tpl_search.php or tpl_search_header.php depending on which search box you're using.

18 Nov 2008, 8:21 AM
#4
bonny avatar

bonny

New Zenner

Join Date:
Nov 2008
Posts:
3
Plugin Contributions:
0

Re: Can I customize the search facility to exclude descriptions?

Thank you for that Dr Byte, will look into that. Is there any way to include attributes in the search results?

18 Nov 2008, 10:36 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Can I customize the search facility to exclude descriptions?

Including attributes in search results will require custom coding, as that's not a built-in feature at the present time.

You can post an ad for paid help in the Commercial Help Wanted section of the forum if that's something you're interested in.

20 Nov 2008, 3:15 AM
#6
reuben avatar

reuben

New Zenner

Join Date:
Apr 2005
Location:
Traralgon
Posts:
51
Plugin Contributions:
0

Re: Can I customize the search facility to exclude descriptions?

DrByte:

Um, no, you won't find it in a language file.

To tell the search not to use the description, simply set the right parameter: Use the Developers Toolkit and search the catalog-side template files for search_in_description = 1 and change it to 0 instead of 1 in the appropriate file ... typically either tpl_search.php or tpl_search_header.php depending on which search box you're using.

This worked for me.
Edit /includes/templates/your_template/sideboxes/tpl_search.php
Note that this applies the change only the quick search sidebox.

Thanks Dr. Byte.

Reuben

20 Nov 2008, 3:28 AM
#7
bonny avatar

bonny

New Zenner

Join Date:
Nov 2008
Posts:
3
Plugin Contributions:
0

Re: Can I customize the search facility to exclude descriptions?

A million thanks Reuben:clap::clap:

Can you work your mojo on the attribute search problem too?:smile:

14 Aug 2009, 12:46 PM
#8
fergusmacdonald avatar

fergusmacdonald

Zen Follower

Join Date:
Oct 2007
Location:
Edinburgh, Scotland
Posts:
243
Plugin Contributions:
0

Re: Can I customize the search facility to exclude descriptions?

On my version, the code is not

search_in_description = 1

but

'search_in_description', '1'

and you can find it in two files:

/includes/templates/template_default/sideboxes/tpl_search.php

and

/includes/templates/template_default/sideboxes/tpl_search_header.php

If you want to change this, move the files to:
/includes/templates/YOUR_CUSTOM_TEMPLATE/sideboxes/
and edit the line

'search_in_description', '1'

to be

'search_in_description', '0'

Hope this helps.