Redirect to woocommerce checkout after adding to cart – item already in cart
Q: Is there a way to empty the cart before adding the product 1234? A: Before adding a product to the cart, it is possible to empty the cart so that the add_to_cart_redirect hook will always be called. Use the woocommerce_add_to_cart_validation hook to alter the cart before adding a new item. /** * First clear … Read more