Forked from vishalck/woocommerce-custom-thank-you-page-redirect.php
Created
April 18, 2018 19:20
-
-
Save pmkay/0dd2d53aad904c1450c31798e7b5d1b2 to your computer and use it in GitHub Desktop.
Redirect to Custom Thank You page in WooCommerce
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_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/woocommerce/custom-thank-you/' ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment