Support » Plugin: Ajax Search Lite » Some keyword searches don’t return results

  • Filipe Costa

    (@filipecostacom)



    Hi there!

    Thanks for a great plugin!

    I’m having troubles when using some keywords as they don’t return results, but the plugin don’t tell me there are no results, it just keeps searching forever…

    Some examples that don’t work:
    kaspersky
    xiaomi
    redmi

    Some that work:
    smartphone
    hercules
    jumper

    Here is the debug data:
    https://paste.ee/p/ZBVmo

    Thanks!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author wpdreams

    (@wpdreams)

    Hi!

    Thank you very much for the proper details, it helps me a lot.

    So the process fails during the post-process, and I was able to deduct that it is related to product variations. I see you have the custom ajax handler enabled as well. My guess is that there might be some sort of issue getting some of the product variation data, or a class/function might not work with this handler.

    Can you please try turning this option off, and check if that changes anything: https://i.imgur.com/jqWg6Rj.png
    You will have to clear your site cache after making this change.

    Another possibility is to not search the product_variation custom post type, but that of course depends if you need those as results, or not.

    Filipe Costa

    (@filipecostacom)

    Hi and thanks for your help!

    I already tried disabling the custom ajax handler but it didn’t help.

    So… i played with search options on the search field, and if i disable searching in title it works and finds the products! So i went to general options, sources and basics and disabled product_variations and it now works, although i don’t get product variations results 🙁

    One more info, i didn’t update WooCommerce to the latest version yet, i’m still using 2.6.14 because i have several plugins that i’m not sure will work wit WooCommerce 3.x.

    Could searching in title have anything to do with the issue or do you think it has something to do with WooCommerce version? I can even try to use an older version of Ajax Search Lite, because i’m not sure when this issue started…

    What do you recommend and thank you very much for your help!

    Plugin Author wpdreams

    (@wpdreams)

    Hi,

    I think I know what the problem is then. There is a function used to get the product variation link, that might not be available in older WooCommerce versions, I’m not sure.

    Anyways, could you please try the following modification:
    – Open up the wp-content\plugins\ajax-search-lite\includes\classes\search\search_content.class.php file on your server.
    – Scroll to line 659, which should be this:
    if ( $r->post_type == 'product_variation' && class_exists( 'WC_Product_Variation' ) ) {
    – Change that to:
    if ( $r->post_type == 'product_variation' && function_exists('wc_get_product') ) {
    – Save the file.

    Let’s hope that changes something.

    Filipe Costa

    (@filipecostacom)

    Hi there!

    Unfortunately it didn’t help 🙁

    When i have some time i’m going to update WooCommerce to the latest 3.x version and see if that helps, until then i’ll just disable product variations from the search.

    Thanks again and i’ll report here when i have more info!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Some keyword searches don’t return results’ is closed to new replies.