I created an ecommerce using the plugin woocommerce. I am selling only a subscription so the "/cart/" page is useless. I'm trying to get rid of it so that when my customer click on "Add to cart" button, he ends up on the checkout page.
Php – Woocommerce add to cart button redirect to checkout
PHPwoocommerceWordpress
Best Answer
In WooCommerce 3.6 or later you can use
woocommerce_add_to_cart_redirect
(props @roman)Original answer:
you can use a filter in functions.php:
it doesn't seem to work with ajax, but it works from the single product pages, which I think is what you use
On WooCommerce (>= 2.1) the function can be simplified as: