I'm trying to redirect people who click on the add to cart button to the checkout page directly. The add to cart button only is adding the product to cart but not redirecting at all.
The code I use is only working for product with no variations.
I'm using the latest version of woocommerce 3.0.1.
//REDIRECT TO CHECKOUT
add_filter ('add_to_cart_redirect', 'redirect_to_checkout');
function redirect_to_checkout() {
return WC()->cart->get_checkout_url();
}