Last active
April 9, 2018 13:38
-
-
Save junixdev/1c0dbd369653b02cd0f1ddc4da6b755e to your computer and use it in GitHub Desktop.
Skip the Cart page entirely and proceed to Checkout page when adding a product to the cart session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter ('woocommerce_add_to_cart_redirect', 'junix_redirect_to_checkout'); | |
function junix_redirect_to_checkout() { | |
$checkout_url = WC()->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