Skip to content

Instantly share code, notes, and snippets.

@noellesteegs
Created August 3, 2020 13:04
Show Gist options
  • Save noellesteegs/9f18cec45d10277959d79cb7753a8c82 to your computer and use it in GitHub Desktop.
Save noellesteegs/9f18cec45d10277959d79cb7753a8c82 to your computer and use it in GitHub Desktop.
Skip cart and go straight to checkout when clicking add to cart button in WooCommerce
add_filter('woocommerce_add_to_cart_redirect', 'skip_cart');
function skip_cart() {
global $woocommerce;
$checkout_url = wc_get_checkout_url();
return $checkout_url;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment