How to remove woocommerce added cart items and redirect to checkout?


Staff member
I have a Woocommerce form to 'Add Funds'. It has an amount input field ($20, $30 ...etc.) and a submit button that redirects to cart page with the input amount as total.

Redirect to checkout is working, but the cart items are not getting removed if a user abandons the cart and tries to order again.

I tried numerous solutions for the redirect to checkout, but only one worked.

<strong>Working solution for redirect to checkout:</strong>

<a href="">WooCommerce - Skip cart page redirecting to checkout page</a>

<strong>Solutions not working for redirect to checkout:</strong>

<a href=""></a>

<a href="">Woocommerce add to cart button redirect to checkout</a>

N.B. I have added the working and not working solutions for redirect
to checkout because it may provide an insight as to why the empty cart
solutions are not working.

Incase of emptying cart before adding a new product, none of the solutions are working:

<a href="" rel="nofollow noreferrer"></a>

<a href="" rel="nofollow noreferrer"></a>

<a href=""></a>

<strong>Using Woocommerce 3.2.6 and WordPress 4.9.2</strong>