Last active
November 29, 2018 17:16
-
-
Save jrick1229/848305fcf401f2ef20f5acce8696a46f to your computer and use it in GitHub Desktop.
Redirect customer to a custom thank you page. (original: https://gist.github.com/bernattorras/b1c3643a350dcf1be83ac3b8efe5068d)
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 | |
/** | |
* Function to redirect the customer to a custom 'thank you' page after placing an order | |
**/ | |
add_action( 'template_redirect', 'woo_custom_redirect_after_purchase' ); | |
function woo_custom_redirect_after_purchase() { | |
global $wp; | |
if ( is_checkout() && !empty( $wp->query_vars['order-received'] ) ) { | |
wp_redirect( ' http://localhost:8888/subscriptions/custom-thank-you-page/' ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment