Skip to content

Instantly share code, notes, and snippets.

@viniciusrtf
Created July 18, 2014 03:20
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 viniciusrtf/b4432abbdd10235eb5e3 to your computer and use it in GitHub Desktop.
Save viniciusrtf/b4432abbdd10235eb5e3 to your computer and use it in GitHub Desktop.
WooCommerce Hook: 'Add to Cart' button redirects to Checkout
<?php
/**
* Hook: 'Add to Cart' button redirects to Checkout
*/
add_filter ('add_to_cart_redirect', 'lenura_redirect_to_checkout');
function lenura_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