• I want to redirect to a custom page after my customers make a payment. Now it goes to a very vanilla, “Your order has been received” page. I have been trying to figure this out for a bit and I’m pretty sure I have to add an action hook to my themes function file. And I found some code that I thought would work but it doesn’t.

    add_action( 'woocommerce_thankyou', function(){
    
    global $woocommerce;
    $order = new WC_Order();
       if ( $order->status != 'failed' ) {
        wp_redirect( home_url() ); exit; // or whatever url you want
       }
    });
  • The topic ‘Woo commerce action hook to redirect to custom thank you page’ is closed to new replies.