Last active
January 16, 2019 05:37
-
-
Save renjith-ph/0defbaf8a48d49ec61fc50add6b1b051 to your computer and use it in GitHub Desktop.
Snippet to redirect to checkout page after adding product to 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
/* Snippet to redirect to checkout page after adding product to cart. | |
Created at : 16 Jan 2019 PluginHive Plugins : https://www.pluginhive.com/plugins/ | |
https://gist.github.com/renjith-ph/0defbaf8a48d49ec61fc50add6b1b051 | |
*/ | |
function ph_change_redirect_url_after_adding_product_to_cart( $url ) { | |
$url = wc_get_checkout_url(); | |
return $url; | |
} | |
add_filter( 'woocommerce_add_to_cart_redirect', 'ph_change_redirect_url_after_adding_product_to_cart' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment