Woocommerce final checkout goes to “basket/order-received” instead of just order-received

I am begging for your help, I have been looking this for hours but can’t find the solution.
The title should be pretty self explanatory, when clicking on the final “checkout” / “place order” button, i get redirected into “basket/order-received” instead of just a “order-received”, I don’t understand why the basket always comes in, I have made a custom page in elementor pro and want to redirect on that.

some additonal info :

* In “woocommerce > advanced > page setup, I have indeed the “order received” as checkout endpoint, but it still doesn’t work
* I have tried to add a custom CSS on a child theme (i use astra) : which is

\————————————

add\_action( ‘woocommerce\_thankyou’, ‘bbloomer\_redirectcustom’);

function bbloomer\_redirectcustom( $order\_id ){

$order = wc\_get\_order( $order\_id );

$url = ‘YOUR URL HERE’;

if ( ! $order->has\_status( ‘failed’ ) ) {

wp\_safe\_redirect( $url );

exit;

}

}

​

\—————————————-
but that still doesn’t work, at all.

Please, any help is appreciated, this is such a headache for me.

1 Comment
  1. Probably, a conflict with another plugin or parent theme setting. You have checked [this](https://www.businessbloomer.com/resolved-woocommerce-redirect-custom-thank-page/) but try to increase the priority to 9999.

    `add_action( ‘woocommerce_thankyou’, ‘bbloomer_redirectcustom’, 99999);`

    If that doesn’t work for some reason, try using template_redirect

    add_action( ‘template_redirect’, ‘correct_redirect’ );

    function correct_redirect(){

    /* we need only thank you page */
    if( is_wc_endpoint_url( ‘order-received’ ) && isset( $_GET[‘key’] ) ) {
    wp_redirect(‘any url’);
    exit;
    }
    }

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer