Skip to content

Instantly share code, notes, and snippets.

@BurlesonBrad
Created July 16, 2015 18:08
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 BurlesonBrad/11603d084abc109b9e85 to your computer and use it in GitHub Desktop.
Save BurlesonBrad/11603d084abc109b9e85 to your computer and use it in GitHub Desktop.
For WarFarePlugins
/**
* Redirect user to checkout page directly after adding to cart
*
* @return string
*/
function wc_redirect_to_checkout() {
$checkout_url = WC()->cart->get_checkout_url();
return $checkout_url;
}
add_filter( 'woocommerce_add_to_cart_redirect', 'wc_redirect_to_checkout' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment