Last active
April 4, 2023 09:09
-
-
Save johnmccole/198f660ff876e34a07dc0027f094f750 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// View Order Thank You page. | |
add_filter( 'woocommerce_order_actions', 'show_thank_you_page_order_admin_actions', 9999, 2 ); | |
function show_thank_you_page_order_admin_actions( $actions, $order ) { | |
$actions['view_thankyou'] = 'Display thank you page'; | |
return $actions; | |
} | |
add_action( 'woocommerce_order_action_view_thankyou', 'redirect_thank_you_page_order_admin_actions' ); | |
function redirect_thank_you_page_order_admin_actions( $order ) { | |
$url = $order->get_checkout_order_received_url(); | |
add_filter( 'redirect_post_location', function() use ( $url ) { | |
return $url; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment