Create a woo-commerce custom thank you page and redirect to this page after checkout successful payment the order? Then you are in right place. I’ll show you how to create a custom thank you page and redirect to it after checkout successful place order.
The Woocommerce thank you page is where it shows the order details after placing the order.
WooCommerce Redirect to Custom Thank You Page
Before redirecting followed the steps to the place order:
- Add product to the cart page.
- Fill out the checkout form and select the payment method.
- Click on the place order button.
Following the code added to your theme functions.php file.
function tch_woocommerce_custom_thank_you_page_redirect( $order_id ){ $order = wc_get_order( $order_id ); $url = 'http://localhost/blog/thank-you/'; if ( ! $order->has_status( 'failed' ) ) { wp_redirect( $url ); exit; } }
After that place one order and then check it