• Resolved adejones

    (@adejones)


    I refer to this thread which was unanswered – https://wordpress.org/support/topic/add-to-cart-redirects-to-home/

    So when a user adds to basket, they stay on whatever page they’re on and product is added, unless they search for a product in which case when they add to basket they get redirected to home page and product is added.

    I can only assume this is because on the search results page the URL already has a query string (for the search term) and the link to “add to basket” is replacing the current query string with the new one (?add-to-cart=319)

    Would appreciate a fix for this if possible, thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,

    Is Enable AJAX add to cart buttons on archives checked under WooCommerce > Settings > Products > General?
    By enabling it, you should be able to stay on the same page after adding a product to basket from a search result page.

    Thread Starter adejones

    (@adejones)

    Hi there
    Yes unfortunately that is already checked.

    Hi @adejones

    Hmm…that’s strange. I have enabled AJAX add to cart buttons on archives on my test site which has the latest versions of WordPress, WooCommerce and Storefront(default) theme, and I could not reproduce the same issue.

    As it’s mentioned on the other thread, this may be caused by something that is specific to your site. It could be from some custom code if not your theme or other plugins.

    That said, kindly do a full conflict test to see if the issue disappears: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    If it persists, please share a copy of your site’s System Status. You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”.  Once you’ve done that, paste it here in your response.

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Add to basket on search results redirecting to home’ is closed to new replies.