Search terms both plural and singular.

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search terms both plural and singular.

This topic contains 9 replies, has 2 voices, and was last updated by  Ernest Marcinko 1 month, 2 weeks ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #17020

    hscoms
    Participant

    I would like a user to search for both 'glass' and 'glasses' or 'pot' and 'pots' and get the same results.
    Woocommerce Products search only.
    I may have missed something in the configurations.

    I would appreciate the help.

    harry

    #17023

    Ernest Marcinko
    Keymaster

    Hi Harry,

    Understanding plural/singular nouns is way beyond the plugins capabilities. It would require a very sophisticated dictionary as well as understanding all singular/plural rules of each language, and a very powerful server to process this information.
    There are a few compact solutions, but unfortunately none of them work properly, not even for english language.

    The plugin simply matches the keywords given to the fields chosen by executing a database query. Perhaps the easiest solution in this case are:
    – Using the additional keywords field, that allows asigning more search keywords
    – Using a custom code to replace search phrases with others: Knowledge base – Replacing search keywords

    The first solution is neat for cases where there is only a handful of products that you want to assign custom keywords to. The second solution is more generic, as it replaced wth words within the search phrase directly – for example you can assign the keyword 'glasses' to be replaced simply by 'glass'.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17033

    hscoms
    Participant

    Hi Ernest,

    Thanks for the prompty reply.
    I understand, I will try to work a way around it.

    I do have another question though.
    After a search is made and the user clicks in the search field again to make a new search can we have the cross to show up or the previous keyword to disappear?

    Currently user has to delete the keyword themselves.

    Thanks in advance,
    Harry

    #17042

    Ernest Marcinko
    Keymaster

    Hi Harry,

    I believe displaying the close icon should be possible when the input is focused, by using a small custom code snippet.

    Add this custom code to the functions.php in your theme/child theme directory (copy from line 3 only!). Before editing, please make sure to have a full site back-up just in case!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17048

    hscoms
    Participant

    Hi Ernest,

    Thanks for the help.

    I am amfraid its not actually removing the serch term form the serch field. The cross icon is showing now but no action when clicked.

    Can you you look into it for me.

    Thanks
    Harry

    #17052

    Ernest Marcinko
    Keymaster

    Hi Harry,

    You are right, I was not testing that correctly.

    Try this one instead, it should be better:

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17054

    hscoms
    Participant

    Thank You Ernest. Now its fine.

    My apologies but I do have another question.

    How can user search for SKU of each prodiuct ? What configuration is needed?

    Harry

    #17057

    Ernest Marcinko
    Keymaster

    Hi,

    On the General Options -> Sources panel, search and select the '_sku' custom field: https://i.imgur.com/uTdC1jW.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #17080

    hscoms
    Participant

    Thanks Ernest.

    One last question.
    How can I show the floating search icon only for mobile version?

    Thanks in advance.
    Harry

    #17090

    Ernest Marcinko
    Keymaster

    Hi Harry,

    For each search instance you can adjust on which devices it should be visible. On the General Options -> Mobile Behavior panel you can change that: https://i.imgur.com/74Kwi2p.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.