Last active
February 4, 2019 22:03
-
-
Save corsonr/6725310 to your computer and use it in GitHub Desktop.
WooCommerce - Redirect add to cart to checkout page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter ('woocommerce_add_to_cart_redirect', 'woo_redirect_to_checkout'); | |
function woo_redirect_to_checkout() { | |
$checkout_url = WC()->cart->get_checkout_url(); | |
return $checkout_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Works like a charm for Simple product, however it fails when I add product variations. Any scope of covering that?