Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techskilled/7a1ae22baeecf6a2e5a633e9d341aca4 to your computer and use it in GitHub Desktop.
Save techskilled/7a1ae22baeecf6a2e5a633e9d341aca4 to your computer and use it in GitHub Desktop.
/**
* Remove Cart Stage
* @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