Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2008
    Posts
    1,356
    Plugin Contributions
    1

    Default Limit Search Results To Model Number and Product Title

    I need to limit the search results on one of my websites to the Product Title and model number. The reason being is that if a customer search for a car make and model the search result will render results that are irrelevant just because the content has the same keywords. The way I have my product setup is that the car make and model are listed in the title so if a customer search for a car they will see a relevant result. Plus I am using the model number to display the part number so most customers are going to either search by the car make and model or by the part number.

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,655
    Plugin Contributions
    25

    Default Re: Limit Search Results To Model Number and Product Title

    I believe that searches already include name and model by default. Therefore you would need to remove the other fields from the advanced_search template. To do a thorough job your would probably removes them from the search algorithm in the includes/modules/pages/advanced_search_result/header_php.php file too.
    See and test drive Zen Cart's free templates at zencarttemplates.info

    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Feb 2008
    Posts
    1,356
    Plugin Contributions
    1

    Default Re: Limit Search Results To Model Number and Product Title

    I thought I would post the solution that I found, alter the following lines (around line 323) in the module/pages/advanced_search_results/header.php
    PHP Code:
    $where_str $db->bindVars($where_str':keywords'$search_keywords[$i], 'noquotestring'); 
    To:
    PHP Code:
    $where_str $db->bindVars($where_str':keywords'$search_keywords[$i], 'noquotestring');
                    unset(
    $_GET['search_in_description']); 

  4. #4
    Join Date
    Jun 2009
    Posts
    13
    Plugin Contributions
    0

    Default Re: Limit Search Results To Model Number and Product Title

    Very good. Very useful. Thank you
    LiXiaoYa -- China Wholesale Products

  5. #5
    Join Date
    Sep 2005
    Posts
    445
    Plugin Contributions
    0

    Default Re: Limit Search Results To Model Number and Product Title

    Quote Originally Posted by CoolCarPartsOnline View Post
    I thought I would post the solution that I found, alter the following lines (around line 323) in the module/pages/advanced_search_results/header.php
    PHP Code:
    $where_str $db->bindVars($where_str':keywords'$search_keywords[$i], 'noquotestring'); 
    To:
    PHP Code:
    $where_str $db->bindVars($where_str':keywords'$search_keywords[$i], 'noquotestring');
                    unset(
    $_GET['search_in_description']); 

    I would need TWO search boxes and limit both of them:
    - the first one only to give results of the PRODUCT MODEL
    - the second one only to give results of the PRODUCT NAME / TITLE

    I think it could be somehow lead out of this solution above... It would be nice if anybody can help.

    Elli
    I may be blond but at least I found Zen.

  6. #6
    Join Date
    Mar 2009
    Posts
    435
    Plugin Contributions
    0

    Default Re: Limit Search Results To Model Number and Product Title

    I've used this bit of code also but changed it to 'search_in_title' however, when I search for 'pen' it still brings up irrelevant products that dont have the word 'pen' in their title. Does anyone know how I can sort this?

    Thanks.

  7. #7
    Join Date
    Mar 2009
    Posts
    435
    Plugin Contributions
    0

    Default Re: Limit Search Results To Model Number and Product Title

    sorry, 'search_in_name' which works, however when I search 'pen' a load of hip flasks are still coming up and I cannot see the word pen in their product name at all.

    my site is at http://www.thegreatgiftshop.co.uk

 

 

Similar Threads

  1. Display model number in search results
    By jdw1979 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 22 Jun 2009, 02:58 PM
  2. Replies: 6
    Last Post: 23 Sep 2008, 06:07 AM

Bookmarks

Posting Permissions

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