Woocommerce thank you page after checkout
I think it is time to add the below code snippet to woocommerce to enable custom thank you page.
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
add_action( 'woocommerce_thankyou', 'redirectcustom'); | |
function redirectcustom( $order_id ){ | |
$order = new WC_Order( $order_id ); | |
$url = 'http://yoursite.com/custom-url'; | |
if ( $order->status != 'failed' ) { | |
wp_redirect($url); | |
} | |
} |