• Resolved dorianc

    (@dorianc)


    Hi,

    I have a problem with checkout & cart page when removing the last item in the cart.
    If I remove the item on a cart page – I succesfully get re-directed to the empty cart page. If I try to remove the item on the checkout page – I get 20 re-directs to the checkout page and eventually a timeout because cart is empty and there is nothing to check out. Both URL’s on a red X icon are the same as below – although cart page has a different slug.

    https://white-bg.com/porachka-2?remove_item=f127a3f714240273e254d740ed23f001&_wpnonce=1bcd186273

    Cart: https://white-bg.com/%d0%ba%d0%be%d0%bb%d0%b8%d1%87%d0%ba%d0%b0
    Checkout: https://white-bg.com/porachka-2

    Any help would be appreciated. At the moment I have resolved it with the following snippet:

    add_action( ‘template_redirect’, ’empty_cart_redirection’ );
    function empty_cart_redirection(){
    if( WC()->cart->is_empty() && is_cart() ){
    wp_safe_redirect( esc_url( home_url( ‘/’ ) ) );
    exit;
    }
    }

    The problem with snippet is that when customer checks out – he will get re-directed to the home page instead of a thank you page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Nicola Mustone

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there,
    This kind of problem is usually caused by a conflict with your theme or with another plugin.
     
    The best way to determine this is to:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.`

    Plugin Support abwaita a11n

    (@abwaita)

    Hi,
    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, you were able to find a solution to your problem!

    If you have further questions, please feel free to open a new topic.

    Thanks.

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

The topic ‘Checkout & cart page – remove item issue’ is closed to new replies.