How to setup custom "thank you" page properly?

Here is what you need to do to have a custom order received page (thank you page) working with One Click Upsells.

1. Create a simple page, customize it as you wish and insert a [wc_1cu_order_details] shortcode inside it. This shortcode will display the order details properly.

2. Then you need to add the code from below to your theme's functions.php:

function gb_wc_1cu_redirect_to_cty( $order_id )
    if(mb_strpos( $_SERVER['REQUEST_URI'], '/your-thank-you-page-slug/' ) !== 0)
         $order = wc_get_order( $order_id );
         echo '<script type="text/javascript">window.location.href="/your-thank-you-page-slug/?key=' . $order->get_order_key() . '";</script>';
add_action( 'woocommerce_thankyou', 'gb_wc_1cu_redirect_to_cty', 999 ); 

This code will perform a redirection from the default /order-received/ thank you page to your custom "thank you" page.

Important: But you need to change the "/your-thank-you-page-slug/" in the code above to the actual slug of your custom thank you page.