• Resolved alexbbonzer

    (@alexbbonzer)


    We’ve implemented Advanced Woo Search V. 2.58 and experienced a slightly weird behaviour when searching.

    When you search for some queries and click “view all” then it’ll go to the search results page and show all results + some unrelated ones

    When you search for other queries, it’ll skip straight to the single-product page.

    Example:
    Sirup –> straight to single-product page
    17 products exist in sirup category, and 11 of these has “sirup” in their name.

    On the contrary, the word “malt” only exists in two product titles, but still goes to a search results page.
    that’s a whole other issue in and of itself, but that’s very low priority.

    As an added bonus info, the theme is “Storefront” and let’s say I do a search for “malt” which ends up on the search results page, and then change the query string from:
    /?s=malt&post_type=product&type_aws=true

    to
    /?s=sirup&post_type=product&type_aws=true

    Then WordPress creates a redeirect from the search results page to the product page for the top-product in the suggested-results list.
    x-redirect-by: WordPress

    The main concern is simply that some searches go straight to single-product, and I have no idea what might be the cause.

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

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

    (@mihail-barinov)

    Hi,

    Please try to use this code snippet:

    add_filter( 'woocommerce_redirect_single_search_result', '__return_false' );

    perhaps it will help you.

    Regards

    Thread Starter alexbbonzer

    (@alexbbonzer)

    Hello!

    Thanks for the quick response.
    I implemented the snippet and it works a treat, thank you so much.

    Out of curiosity, do you have an idea/theory as to why the issue happens in the first place? I mean when I search “sirup” and it now goes to the results page, it says “showing a single result” but the results page shows several (correctly identified) sirups.

    Do you know why it only thinks that there’s one?

    Edit:
    My current idea is related to matching, in the sense that the default wordpress search matching only finds one product as there is only ONE product where the title has sirup as a beginning of a word, and then ajax matches all of the products where sirup is anywhere in the word, and so the search page is generated based on wordpress’s matching.

    Best regards, and thanks again

    • This reply was modified 2 years, 4 months ago by alexbbonzer.
    Plugin Author ILLID

    (@mihail-barinov)

    Yes, your idea sounds relevant. AWS plugin rewrite default search results page query, including and query for search results number. But sometimes with some themes or plugins it can have some problems with it. And looks like this is such a case.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“view all” button going directly to single-product’ is closed to new replies.