Custom Redirect Page After Purchase With Order Details
-
I was looking for a few days on how to redirect my customers to a custom ‘Thank you’ page after completing their purchase on my Woocommerce site.
The redirect code is below:
add_action( 'woocommerce_thankyou', 'whitehead_redirect_woo_checkout'); function whitehead_redirect_woo_checkout( $order_id ){ $order = wc_get_order( $order_id ); $url = 'website url'; if ( ! $order->has_status( 'failed' ) ) { wp_safe_redirect( $url ); exit; } }
This code works great, but how do I print the order details on the custom page? Not that it matters, but I’m using Divi as my theme/page builder and when I use the order details module on the new custom page, there’ no info because the data is already processed and gone after the order goes through.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom Redirect Page After Purchase With Order Details’ is closed to new replies.