Created
July 5, 2018 17:08
-
-
Save bernattorras/83c746e5fe230c35bb438346dcd5d0cc to your computer and use it in GitHub Desktop.
Function to redirect the customer to a the checkout page (or a custom page) after adding a product to the cart
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 | |
/** | |
* Function to redirect the customer to a the checkout page (or a custom page) after adding a product to the cart | |
**/ | |
add_filter ('woocommerce_add_to_cart_redirect', 'redirect_to_checkout'); | |
function redirect_to_checkout() { | |
return wc_get_checkout_url(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment