title: How to remove woocommerce added cart items and redirect to checkout?
body: <p>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. </p>
  
  <p>Redirect to checkout is working, but the cart items are not getting removed if a user abandons the cart and tries to order again.</p>
  
  <p>I tried numerous solutions for the redirect to checkout, but only one worked.</p>
  
  <p><strong>Working solution for redirect to checkout:</strong></p>
  
  <p><a href="https://stackoverflow.com/questions/39655722/woocommerce-skip-cart-page-redirecting-to-checkout-page">WooCommerce - Skip cart page redirecting to checkout page</a></p>
  
  <p><strong>Solutions not working for redirect to checkout:</strong>  </p>
  
  <p><a href="https://wordpress.stackexchange.com/questions/267071/redirect-to-woocommerce-checkout-after-adding-to-cart-item-already-in-cart">https://wordpress.stackexchange.com/questions/267071/redirect-to-woocommerce-checkout-after-adding-to-cart-item-already-in-cart</a></p>
  
  <p><a href="https://stackoverflow.com/questions/15592633/woocommerce-add-to-cart-button-redirect-to-checkout">Woocommerce add to cart button redirect to checkout</a>  </p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>Incase of emptying cart before adding a new product, none of the solutions are working:</p>
  
  <p><a href="https://gist.github.com/viniciusrtf/b49403b5f87dcd7699c1" rel="nofollow noreferrer">https://gist.github.com/viniciusrtf/b49403b5f87dcd7699c1</a></p>
  
  <p><a href="https://hungred.com/how-to/empty-woocommerce-cart-adding-item/" rel="nofollow noreferrer">https://hungred.com/how-to/empty-woocommerce-cart-adding-item/</a></p>
  
  <p><a href="https://wordpress.stackexchange.com/questions/267071/redirect-to-woocommerce-checkout-after-adding-to-cart-item-already-in-cart">https://wordpress.stackexchange.com/questions/267071/redirect-to-woocommerce-checkout-after-adding-to-cart-item-already-in-cart</a></p>
  
  <p><strong>Using Woocommerce 3.2.6 and WordPress 4.9.2</strong></p>