WizSeller Help Desk Latest Questions

Woo Commerce Redirect The Thank You Page

Wizseller Helpdesk
WordPress Expert (15 Years)

Paste this code into your Theme Function (in Appearance> Theme File Editor) file and save.

add_action( 'woocommerce_thankyou', 'bbloomer_redirectcustom');
function bbloomer_redirectcustom( $order_id ){
$order = wc_get_order( $order_id );
$url = 'https://yoursite.com/custom-url';
if ( ! $order->has_status( 'failed' ) ) {
wp_safe_redirect( $url );
exit;
}
}

Sorry, you do not have permission to answer to this question.