Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created November 25, 2014 22:39
Show Gist options
  • Save lmartins/6e2337be8164706ac331 to your computer and use it in GitHub Desktop.
Save lmartins/6e2337be8164706ac331 to your computer and use it in GitHub Desktop.
Skip the Cart in the checkout process
/**
* Skip the Cart
* @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