Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trangsihung/e32cf6fbdaf67588565559f7bd6b86b9 to your computer and use it in GitHub Desktop.
Save trangsihung/e32cf6fbdaf67588565559f7bd6b86b9 to your computer and use it in GitHub Desktop.
woocommerce
<?php
// Add to cart checkout redirect
function custom_add_to_cart_redirect() {
$checkout_ = get_permalink( get_option( 'woocommerce_checkout_page_id' ) );
return $checkout_
}
add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment