add_action( 'woocommerce_thankyou', 'pfwp_redirect_woo_checkout'); function pfwp_redirect_woo_checkout( $order_id ){ $order = wc_get_order( $order_id ); $url = 'https://coachzul.com/th4nxs/'; if ( ! $order->has_status( 'failed' ) ) { wp_safe_redirect( $url ); exit; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter