Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2006
    Posts
    24
    Plugin Contributions
    0

    Default How do i get the basic search to only search title?

    My version of Zencart is 1.3.8a

    The search function in the sidebox searches both title and description by default, is there a way to make this search only the title by default as many of my items descriptions have the keywords for other items in them making the search results a bit useless. I'd rather only show 3 or 4 items with the word in the title than 50 with the word in the description, especially if the ones with it in the title end up lost at the end!

    Cheers

    Phil

  2. #2
    Join Date
    Jul 2006
    Posts
    308
    Plugin Contributions
    0

    Default Re: How do i get the basic search to only search title?

    I think you can comment out this code in

    includes/modules/pages/advanced_search_result/header.php

    Code:
            if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) {
              $where_str .= " OR pd.products_description
                              LIKE '%:keywords%'";
    
              $where_str = $db->bindVars($where_str, ':keywords', $search_keywords[$i], 'noquotestring');
            }

  3. #3
    Join Date
    Feb 2006
    Posts
    24
    Plugin Contributions
    0

    Default Re: How do i get the basic search to only search title?

    Thanks fakeDecoy

    Unfortunately it didn't do it quite right, it did cut down my results a little.

    the site is www.homebrewandwinemaking.co.uk and doing a search for 'yeast' returns anything with 'yeast' in the descriptions not just in the item title.

    The offering from fakedecoy (mypage was header_php.php) stopped a couple of results but not the bulk of them, if the item is called "beer kit", with a description of "this beer kit comes with yeast" Then i don't want it returned when I do a basic search for 'yeast'.

    I would rather only show: "Yeast for beer", "Yeast for wine", etc rather than anything with yeast in the rest of the listing.

    Thanks in advance

    Phil

  4. #4
    Join Date
    Jan 2009
    Location
    Montreal, Canada
    Posts
    228
    Plugin Contributions
    0

    Default Re: How do i get the basic search to only search title?

    See this thread-

    http://www.zen-cart.com/forum/showthread.php?p=644559

    I changed a few instances of 1 to 0 (uploaded and tested one at a time) and my search improved, but it still did not limit the results to titles. Hm... Let me know if and how you do better.

    R

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

    Default Re: How do i get the basic search to only search title?

    Hey,

    I've also used that thread to update my search results to exclude descriptions, however searches appear to be searching in other areas.

    Specifically, they appear to be searching the meta descriptions. Does anyone know how to stop the search functionality searching meta information?

    Thanks.

 

 

Similar Threads

  1. v139h Limit the search default to only search titles and not description
    By amyleew in forum General Questions
    Replies: 6
    Last Post: 31 Dec 2013, 07:22 AM
  2. Can I search in only the product title at all times?
    By shadswill in forum General Questions
    Replies: 0
    Last Post: 14 Jan 2013, 03:52 PM
  3. v150 How do I change the title on search engines to my site name?
    By coucho in forum General Questions
    Replies: 1
    Last Post: 29 Jun 2012, 01:11 PM
  4. Can I make the Search Sidebox Search the Titles Only ?
    By milobloom in forum General Questions
    Replies: 4
    Last Post: 30 Apr 2011, 06:20 AM
  5. Removing the 'Advanced Search' and changing basic search to title only
    By val-ent in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 30 Aug 2008, 11:39 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