Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    7
    Plugin Contributions
    0

    Default Internal Search and Advanced Search queries broken

    [In the forums, I find a lot about "search" ala google and other external engines. This question is about the keyword search and advanced search features of zen-cart that find products from the store inventory for customers.]

    Our categories are in Title Case (e.g. Running Pants, Denim, Casual Wear). Also Title Case is used in some product descriptions, when they are not proper English sentences.

    It seems that advanced search and search queries from the home page are not matching our text that is in Title Case.

    If we leave the first letter off, then we get hits:

    so "enim" matches all the "Denim" items,

    but "Denim" and "denim" match nothing.

    This is a big issue for us.

    I looked through a zen-cart manual that we had purchased, and I went through the admin panel to see whether there is any sort of index-building that I need to do. I was unable to find any information about setup associated with the query, so I'm surmising that it must be a direct SQL query on "raw" product table attributes.

    I'm not a prolific SQL/php programmer, but I did grep through the code several times; however, I have been unable to find the keystone holding up the search query.

    Using zen v1.3.8sp1 with a few common mods installed (RMA, Easy Populate, Zone Rates)

    Any pointers?
    Thanks.

  2. #2
    Join Date
    Nov 2009
    Posts
    7
    Plugin Contributions
    0

    Default Re: Internal Search and Advanced Search queries broken

    Nobody pointed me in the right direction. After a good deal of time, this is the solution I came up with:

    includes/modules/pages/advanced_search_result/header_php.php

    around line 292, there is a for-loop which iterates over each keyword, building up the appropriate query string.

    I duplicated the block, enclosed the two blocks' string output with "()" and linked them with OR so that I don't get crazy order-of-operations side effects.

    For the second block, I used the php function mb_convert_case( $str, MB_CASE_TITLE) to convert each of the keywords at each of the four instances where they are bound to the query.

    So now, I can match keywords to lower case and Title Case in my product names and descriptions (and other fields).

    Seems to be working.

  3. #3
    Join Date
    Dec 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Internal Search and Advanced Search queries broken

    Oh man drone115b. You are teh awesome. I just followed your instructions and got my search to work beautifully. I searched the web for a 'zen cart search' fix and finally found this post when I looked for 'zen cart search broken'. I hope other will find this and benefit from it as I have. Well done sir.

 

 

Similar Threads

  1. v150 padlock on login broken, because of header search and sidebox search. Any fix?
    By zenartman in forum Customization from the Admin
    Replies: 6
    Last Post: 11 Apr 2015, 06:30 AM
  2. Difference between 'search' and 'advanced search'
    By weblamer in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 18 Feb 2011, 08:19 PM
  3. Search and Advanced search not returning results
    By paisore in forum General Questions
    Replies: 6
    Last Post: 4 Nov 2010, 03:43 PM
  4. Replies: 5
    Last Post: 20 Apr 2010, 12:54 PM
  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