Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Search results - Including 'plural' searches??

    Hi there. Back with yet another question!! At the moment, if someone searches for something using the plural, they get no result (unless it was described in plural), but only if they write singular. I know that some searches I have seen will return the singular results even if the search is for plural.

    Ex. My client is selling plants and bulbs. If someone goes on and searches for 'apple' there is a list of the different types of apple trees on offer. But if someone searches for 'apples', there are no results.

    Is it possible to somehow adapt the search feature within zen-cart to include singular results in a plural search (if that makes sense?!)? I have looked right through the advanced_search_results and advanced_search files and have altered a couple of things in them for the vissual aspect of the search result, but can't see any way of altering the way in which the search takes place.
    The site is www.plantperfection.co.uk (currently you need to log in to see the search in action - you can use email address skyegospel################## and password Test1 )

    Thank you very much in advance for any advise any one can offer on this.

    Stuart

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

    Default Re: Search results - Including 'plural' searches??

    This is much more complicated than it sounds. This is because Zen Cart is multilingual, so would need to find a way to recognise plurals in all languages and convert them to singulars. It's actually suprisingly difficult to do this in English alone. However, it you want to have a go, the file that would need changing would be the includes/modules/pages/advanced_search_result/header_php.php. You'd need to apply your rules to adjust the $_GET['keyword'] variable very near the top of the file.
    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
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Search results - Including 'plural' searches??

    And if you need reference to write such functions, this may help:
    http://api.cakephp.org/inflector_8ph...ce.html#l00166
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Re: Search results - Including 'plural' searches??

    Brilliant - thank you guys. I'll have a crack at that tomorrow. I'm glad to know that it is a possibility.

    Thanks again for the help,

    Stuart

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Search results - Including 'plural' searches??

    Some may argue that this is not a good idea, but I've seen that many sites will insert custom metatag keywords which include the common misspellings of key search terms, so that their results are more likely to be found in search engines. Since the Zen Cart search also searches metatags data, you could try adding your pluralized keywords in your custom metatags keywords (per-product, via the admin), thus giving you the benefit of both search-engine searches and store-specific searches ... thus saving you custom coding.
    .

    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
    Aug 2008
    Location
    Isle of Skye, Scotland
    Posts
    92
    Plugin Contributions
    0

    Default Re: Search results - Including 'plural' searches??

    Thanks Dr Bryte - I am going ahead with that as I am keen to have the meta info in there any way.

    Thanks for your help

    Stuart

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Search results - Including 'plural' searches??

    The other possible approach to test would be to use the MySQl match function which supports natural language searches on suitably indexed tables.
    Kuroi Web Design and Development | Twitter

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

 

 

Similar Threads

  1. Search feature that only searches 1 category
    By gtgderek in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 31 Aug 2009, 02:57 PM
  2. Search results including Review Text
    By awhfy99 in forum General Questions
    Replies: 0
    Last Post: 26 Oct 2008, 02:00 AM
  3. Is there a way to have advanced search results open the results in a new window?
    By member in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Mar 2008, 08:27 PM
  4. Search Box only searches products - can it search EZpages?
    By uiserloh in forum General Questions
    Replies: 1
    Last Post: 29 Jan 2008, 06:56 PM
  5. Replies: 8
    Last Post: 5 Dec 2006, 10:52 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR