Support » Plugin: WooCommerce » Woocommerce: Redirect to the cart page on Mobile not working

  • Resolved jacsify

    (@jacsify)


    Hi,
    I have Redirect to cart page selected in the Woocommerce settings page. It works perfectly on pc/laptop, but does not work on Mobile… it just stays on the same product page and then you have to click on Menu>Cart which is tiresome. Loosing business. Please help. This is driving me insane. I even added this code to my functions.php file:

    add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
    
    function redirect_to_checkout() {
       global $woocommerce;
       $checkout_url = $woocommerce->cart->get_checkout_url();
       return $checkout_url;
    }

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

Viewing 1 replies (of 1 total)
  • Plugin Support AW

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    There’s a couple things that look a bit off to me, let me go through them

    * The cart and checkout page are the same, which a lot of times can cause issues if you’re not using a plugin that is intended to make it that way.
    * The issue isn’t between mobile and desktop, it’s that the only button that redirects is from the product archive, the box that “slides up” when you hover it, which only works on a desktop. Adding from the product page doesn’t redirect at all.
    * The WooCommerce setting is for redirecting to cart, but your snippet is for redirecting to checkout.

    So noting all this, I would recommend doing conflict testing to see if there’s something (custom code, plugin, or theme) that is causing this.

    The expected behavior on WooCommerce side would be to click the add to cart button (anywhere) and then redirect to the cart page.

    So for the conflict testing, I would recommend doing this on a staging site, or if that’s not possible, using https://wordpress.org/plugins/health-check/ to run this to minimize disruptions on your site.

    Hopefully that helps! Have a great one!

Viewing 1 replies (of 1 total)
  • The topic ‘Woocommerce: Redirect to the cart page on Mobile not working’ is closed to new replies.