Different behavior in live search vs search results page

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Different behavior in live search vs search results page

This topic contains 4 replies, has 2 voices, and was last updated by linkitaly17 linkitaly17 3 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #25322
    linkitaly17
    linkitaly17
    Participant

    We are using your plug-in to search in our WooCommerce store. We added the product SKU in your plug-in search criteria but it only works in live search and not in the results page.

    For example, if you enter the SKU code “CVS LK01N6S2” in the search box, the live search correctly shows the product but if you hit Enter to load the WooCommerce search page the list shows empty.

    Is it a bug or did we forget to enable something?

    #25326
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Make sure that the search results override feature is enabled, that should do the trick.

    Best,
    Ernest Marcinko

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


    #25331
    linkitaly17
    linkitaly17
    Participant

    Thank you for the quick answer. Unfortunately it was already enabled. What is strange is that it works correctly with any other keyword, just not with the SKU.

    #25334
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    I noticed you are using an elementor template for that page.

    Recently a similar issue was reported, it only occured twice so far. There was a problem with the detection of the query, and I had to directly modify one of the files.

    For now, you should be able to resolve it via a small custom code snippet, until the next release is out. Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

    add_filter('asp_query_is_search', 'asp_query_is_search_override', 10, 2);
    function asp_query_is_search_override( $is_search, $wp_query ) {
    	return method_exists($wp_query, 'is_search') && $wp_query->is_search();
    }
    Best,
    Ernest Marcinko

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


    #25355
    linkitaly17
    linkitaly17
    Participant

    Thank you, at first the code seemed to solve the problem but then I realized that it broke other Elementor widgets.

    Since you say you’re aware of this problem and you are going to fix it with next release, I guess I’ll just have to wait for next release.

    Thanks a lot for your support.

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

You must be logged in to reply to this topic.