Created
August 3, 2020 13:04
-
-
Save noellesteegs/9f18cec45d10277959d79cb7753a8c82 to your computer and use it in GitHub Desktop.
Skip cart and go straight to checkout when clicking add to cart button in WooCommerce
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
add_filter('woocommerce_add_to_cart_redirect', 'skip_cart'); | |
function skip_cart() { | |
global $woocommerce; | |
$checkout_url = wc_get_checkout_url(); | |
return $checkout_url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment