Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #341625

    In the old days WooCommerce shipped with a “thank you” page but these days they use endpoints….. What I would like to do, and I am struggling to find a suitable answer anywhere (Woo Support is about as fast as treacle!!!), is to redirect to a thank you page or endpoint rather than a summary or order-received….

    But how?

    #342584

    Hey Adendum!

    Try adding this code to theme / child theme functions.php:

    add_action( 'woocommerce_thankyou', function( $order_id ){
        $order = new WC_Order( $order_id );
    
        $url = 'http://redirect-here.com';
    
        if ( $order->status != 'failed' ) { 
            echo "<script type="text/javascript">window.location = '".$url."'</script>";
        }
    });

    Reference:
    http://stackoverflow.com/questions/25114082/woocommerce-action-hook-to-redirect-to-custom-thank-you-page

    Please note that this request is outside our support scope.

    Regards,
    Josue

    #342740

    Josue,

    Yup – found the same in WooCommerce documentation last night. Sorted.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to …. get to the Woocommerce Thank You page’ is closed to new replies.