01
December
2021
Learn to add a custom thank you page redirect to your WooCommerce store using 2 different methods:
1) Using a PHP function.
2) Using our Custom TY Pages Pro Plugin
Needed Php Function:
1 2 3 4 5 6 7 8 9 10 11 | <?php // Your PHP code goes here! add_action( 'template_redirect', 'handsomewp_custom_redirect_after_purchase' ); function handsomewp_custom_redirect_after_purchase() { global $wp; if ( is_checkout() && !empty( $wp->query_vars['order-received'] ) ) { wp_redirect( '/your-custom-thank-you-page-url-here/' ); exit; } } |
or request our WooCommerce TY Pages Pro plugin.
Leave a Reply