• Resolved cedricbaguilar

    (@cedricbaguilar)


    When adding a product to the basket on my website, the client is immediately redirected to the cart, which is something I don’t want. I want the customer just to see a small message that says that the item has been added to the cart, but not actually redirecting them anywhere. What do I need to modify or what setting do I have to change so that the customers are not redirected?

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • Stef

    (@serafinnyc)

    Hello @cedricbaguilar chances are you have a setting set in your theme that’s doing that. Out of the box WooCommerce doesn’t do that.

    Please go to WooCommerce > Settings > Products and make sure the Redirect to Cart is not enabled in the Add to cart behaviour section.

    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    Hi @serafinnyc

    Thanks a lot for the quick answer. I already checked that and nothing is selected. There would be the button for redirection to the cart, but not actually the checkout page, which is what happens in my case. So I have no idea where this comes from. Also in terms of redirection the thank you page on my website as well is customized but nothing really displays as is designed and the built in purchase summary is not at all displayed…

    Stef

    (@serafinnyc)

    It appears someone has added custom hooks @cedricbaguilar or you’re using a plugin that’s doing this. Check your plugins and I’d also check within the theme’s functions.php file and or Astra’s settings.

    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    How do I exactly check for this in particular. I have a lot of plugins, and I am not sure that I can check all their function.php Is there a quick way for me to check this?

    Stef

    (@serafinnyc)

    You want to look for an app called cart, checkout or something redirect @cedricbaguilar and the same goes for functions.php

    That hook might look like this:

    function redirect_to_checkout_after_add_to_cart() {
    // Only redirect on single product pages
    if (is_product()) {
    wp_safe_redirect(wc_get_checkout_url());
    exit;
    }
    }
    add_action('woocommerce_add_to_cart', 'redirect_to_checkout_after_add_to_cart');
    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    I see well thanks. Wouldn’t it maybe be easier for me to just create a code snippet that tells not to redirect?

    And then for the thank you page, what advice could you give there?

    Stef

    (@serafinnyc)

    @cedricbaguilar No, not necessarily. It’s best to find these things in order to operate a well maintained website.

    For the Thank You page I’ll wait for one of my colleagues to answer that as I can’t think of any off the top of my head. Plus if you already have a redirect plugin added it’s best to use that one then.

    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    Haha, yes agreed it is good to find the cause of the problem and fix it. I found the culprit plugin and it is was codesigner. I will now look for the redirection function there and try to solve it that way.

    For the thank you page the plugin works well, the redirection as such works, but the final site is not displayed as it should, which is a pity…

    Stef

    (@serafinnyc)

    Excellent ???? best of luck. Let us know if you need any further assistance with this. If anything new please create a separate ticket. Thanks

    Thread Starter cedricbaguilar

    (@cedricbaguilar)

    Thanks for your help. I appreciate the quick answers!

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