If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Categories, Products, Attributes / Stop search in description?

Stop search in description?

Started by helmetdecals on 15 Jan 2009, 12:46 AM · Views: 3,239

Results 1 to 12 of 12
15 Jan 2009, 12:46 AM
#1
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

Stop search in description?

is there any way of customizing what the search engine searches for in the general search? I don't want the general search searching the description...just product title and keywords.
any help would be appreciated.

15 Jan 2009, 1:19 AM
#2
data_digger avatar

data_digger

Zen Follower

Join Date:
Jan 2009
Posts:
222
Plugin Contributions:
2

Re: Stop search in description?

Add following code to default search form:

<input type="hidden" name="search_in_description" value="0">

to remove product description from search engine.
Unfortunately You can't control other fields this way (manufacturers name, products model, name, meta tags etc).

15 Jan 2009, 6:51 AM
#3
drbyte avatar

drbyte

Sensei

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

Re: Stop search in description?

data_digger:

Add following code to default search form:

<input type="hidden" name="search_in_description" value="0"> ``` > to remove product description from search engine. > Unfortunately You can't control other fields this way (manufacturers name, products model, name, meta tags etc). Rather than adding code, why not just set the existing search_in_description field to 0 instead of 1

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Jan 2009, 1:24 PM
#4
helmetdecals avatar

helmetdecals

New Zenner

Join Date:
Jan 2009
Posts:
26
Plugin Contributions:
0

Re: Stop search in description?

I tried changing the value to "0" but then it won't search "keywords" I have hidden in the description.

22 Jan 2009, 6:56 PM
#5
drbyte avatar

drbyte

Sensei

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

Re: Stop search in description?

helmetdecals:

I tried changing the value to "0" but then it won't search "keywords" I have hidden in the description.
Um ... ya. You said you wanted to not search the description. Are you changing your mind now?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

11 Feb 2011, 7:57 AM
#6
igofresh avatar

igofresh

Zen Follower

Join Date:
Oct 2010
Posts:
149
Plugin Contributions:
0

Re: Stop search in description?

I need to eliminate description searches (I'm sure;))
Can you tell me what file this modification refers to?
I'm running 1.3.9f

History does not repeat itself but it does rhyme - Mark Twain

13 Feb 2011, 12:22 AM
#7
igofresh avatar

igofresh

Zen Follower

Join Date:
Oct 2010
Posts:
149
Plugin Contributions:
0

Re: Stop search in description?

I haven't found a complete answer on setting search default to exclude product description.
code is provided here:
http://www.zen-cart.com/forum/showthread.php?t=117702
The code listed there is for the "default search form";

<input type="hidden" name="search_in_description" value="0">

I understand the search value should be 1 rather than 0
But I am limited by my knowledge of which specific file to change the default search value in.
Can anyone tell which file to edit?

I'm - https://www.igofresh.com (ZC 1.3.9f)

History does not repeat itself but it does rhyme - Mark Twain

20 Feb 2011, 6:26 AM
#8
drbyte avatar

drbyte

Sensei

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

Re: Stop search in description?

search the template files for "search_in_description" using the Developers Toolkit:
https://www.zen-cart.com/tutorials/index.php?article=38
https://www.zen-cart.com/tutorials/index.php?article=39

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

2 Mar 2011, 3:17 AM
#9
wilsonshen avatar

wilsonshen

New Zenner

Join Date:
Apr 2010
Posts:
53
Plugin Contributions:
0

Re: Stop search in description?

HI, DrByte.
I search the code in Developers Toolkit: search_in_description, and did the following change:

  1. /includes/templates/gadgets_yellow/sideboxes/tpl_search.php
    Line #13 : $content .= zen_draw_hidden_field('search_in_description', '0') . zen_hide_session_id();

  2. /includes/templates/gadgets_yellow/sideboxes/tpl_search.php
    Line #13 : $content .= zen_draw_hidden_field('search_in_description', '0') . zen_hide_session_id();

  3. /includes/templates/gadgets_yellow/templates/tpl_search_header.php
    Line #10 : $content .= zen_draw_hidden_field('search_in_description', '0') . zen_hide_session_id();

4./includes/templates/gadgets_yellow/templates/tpl_search_header.php
Line #10 : $content .= zen_draw_hidden_field('search_in_description', '0') . zen_hide_session_id();

However, it doesn't work. It still searches in the description.

5 Mar 2011, 5:57 AM
#10
wilsonshen avatar

wilsonshen

New Zenner

Join Date:
Apr 2010
Posts:
53
Plugin Contributions:
0

Re: Stop search in description?

Hi,
I solved the problem:

/YOUR_STORE/includes/templates/YOUR_TEMPLATE/templates/tpl_search_header.php

Line #10 : $content .= zen_draw_hidden_field('search_in_description', '1') . zen_hide_session_id();

modify the '1' to '0'

8 Sep 2011, 1:15 AM
#11
chrisg1314 avatar

chrisg1314

New Zenner

Join Date:
Aug 2011
Posts:
6
Plugin Contributions:
0

Re: Stop search in description?

I have tried all of the above, but my search function is still searching the product descriptions when searching, I only want it to search the product titles?

Can anyone help?

Regards,
Chris

8 Sep 2011, 1:55 AM
#12
drbyte avatar

drbyte

Sensei

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

Re: Stop search in description?

Well, given that the instructions given earlier in this thread are the correct instructions, it seems like you missed something.
So, instead of saying "I have tried all of the above", you're going to need to be much more specific if you want help figuring out what went wrong.
Start with doing the developers-toolkit search and selecting lookup-in-all-files, and post the results you get. Also include the name of your currently selected template. And, when you post, be sure to also include all the answers to the questions asked in the Posting Tips section of the screen you see when you click the Reply button below.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.