Created
November 25, 2014 22:39
-
-
Save lmartins/6e2337be8164706ac331 to your computer and use it in GitHub Desktop.
Skip the Cart in the checkout process
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
/** | |
* Skip the Cart | |
* @see: http://stackoverflow.com/questions/15592633/woocommerce-add-to-cart-button-redirect-to-checkout | |
*/ | |
add_filter( 'add_to_cart_redirect', 'redirect_to_checkout' ); | |
function redirect_to_checkout() { | |
global $woocommerce; | |
$checkout_url = $woocommerce->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