• Resolved jazzu

    (@jazzu)


    Hello!

    I’m trying to set up a thank you page, but for whatever reason, no matter which plugin I use, when I complete an order, instead of being shown a thank you screen, I’m just redirected to homepage.

    I added a custom checkout and a custom thank you page. The checkout works, however when I confirm the order, the URL shows that it starts to load the thank you page, but after a split second changes to home page.

    Is there a setting for thank you pages that I’m missing?

    What’s going on?

    Thank you!

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you look at:
    Dashboard > WooCommerce > Settings > Advanced tab > Checkout endpoints, you can see the endpoint for the order received page, usually this is order-received. The endpoint is processed by the [woocommerce-checkout] shortcode, but if you are not using that you’ll have to process it yourself. This could be in your custom checkout code, or, if its already generating the correct url, use a redirection plugin to redirect it to your custom thank-you page.

    Thread Starter jazzu

    (@jazzu)

    Hi @lorro !

    Thank you for your reply! I am still using [woocommerce-checkout] shortcode, just on a custom made page. You can see it here.

    I went into WooCommerce checkout endpoints, and I’m using the correct checkpoint. I’m using the endpoint “hvala”. Howerver, the problem still persists. Even if you try to access the thank you page directly, without going to the checkout page, it still just redirects to homepage.

    Here’s the URL of the thank you page: https://moja-savna.si/hvala/

    Thank you for your time!

    Thread Starter jazzu

    (@jazzu)

    Hi everyone!

    I’m laughing pretty badly right now. At some point in time, I actually added this code to functions.php for whatever reason, which was the reason for redirecting me.

    The code was:

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

    I removed the code and it works normally now.

    Sorry for wasting your time, but thank you for assistance nonetheless!

    Mirko P.

    (@rainfallnixfig)

    Hi @jazzu,

    Oh! You forgot about that custom code but it happens ??

    I’ll mark this topic as solved for now. Please feel free to open a new topic if you have any other questions.

    Have a good one!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Want to create a thank you page but I’m redirected to home page’ is closed to new replies.