Created
August 22, 2020 13:05
-
-
Save Njengah/24507f70df6096a97d72b551be10deb7 to your computer and use it in GitHub Desktop.
WooCommerce Redirect After Purchase - tutorial - https://njengah.com/woocommerce-redirect-after-checkout/
This file contains hidden or 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 | |
/* Redirect user after check out */ | |
add_action( 'template_redirect', 'njengah_custom_redirect_after_purchase' ); | |
function njengah_custom_redirect_after_purchase() { | |
global $wp; | |
if ( is_checkout() && ! empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( 'http://www.yoururl.com/your-page/' ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment