Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2008
    Posts
    3
    Plugin Contributions
    0

    Default 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.

  2. #2
    Join Date
    Jun 2007
    Location
    Texas, USA
    Posts
    1,400
    Plugin Contributions
    1

    Default 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

  3. #3
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default 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.
    .

    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.

  4. #4
    Join Date
    Nov 2008
    Posts
    3
    Plugin Contributions
    0

    Default 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?

  5. #5
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default 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.
    .

    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.

  6. #6
    Join Date
    Apr 2005
    Location
    Traralgon
    Posts
    56
    Plugin Contributions
    0

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

    Quote Originally Posted by DrByte View Post
    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

  7. #7
    Join Date
    Nov 2008
    Posts
    3
    Plugin Contributions
    0

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

    A million thanks Reuben

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

  8. #8
    Join Date
    Oct 2007
    Location
    Edinburgh, Scotland
    Posts
    243
    Plugin Contributions
    1

    Default 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.

 

 

Similar Threads

  1. Can I exclude some products from the site search?
    By jen_ny in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 11 Oct 2010, 08:20 PM
  2. Can I exclude some products from the site search?
    By jen_ny in forum General Questions
    Replies: 2
    Last Post: 8 Oct 2010, 06:38 PM
  3. Search Facility
    By BobDGinn in forum Addon Sideboxes
    Replies: 3
    Last Post: 12 Sep 2010, 03:55 PM
  4. Replies: 0
    Last Post: 14 Aug 2010, 12:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg