• Resolved mirons

    (@mirons)


    Hi,

    After spending hours trying to figure out why xstore product filtering doesn’t filter all search results with this plugin, I think I finally realized the issue.

    It seems that on search results page containing post_type=product in the url, whenever the filtering has only one product to display (from multiple products displayed in the search results), it won’t filter the products to display the single product on the search results page because the search plugin default behavior is to go directly to the single product page whenever there’s only one product in the results.

    To resolve this, it would be highly appreciated if you could please let me know what I can add to functions.php in order to modify this default behavior so that whenever a product search has only one search result it would display that product on a search results page instead of redirecting straight to that product page.

    Thank you very much and have a fantastic year!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    You can do this by using following code snippet:

    add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );

    Regards

    Thread Starter mirons

    (@mirons)

    Thank you very much!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.