Skip to content

Instantly share code, notes, and snippets.

@kloon
Created December 5, 2012 19:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kloon/4218596 to your computer and use it in GitHub Desktop.
Save kloon/4218596 to your computer and use it in GitHub Desktop.
WooCommerce redirect to checkout page after add to cart
// Add to cart checkout redirect
function add_to_cart_checkout_redirect() {
wp_safe_redirect( get_permalink( get_option( 'woocommerce_checkout_page_id' ) ) );
die();
}
add_action( 'woocommerce_add_to_cart', 'add_to_cart_checkout_redirect', 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment