Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Last active April 4, 2023 09:09
Show Gist options
  • Save johnmccole/198f660ff876e34a07dc0027f094f750 to your computer and use it in GitHub Desktop.
Save johnmccole/198f660ff876e34a07dc0027f094f750 to your computer and use it in GitHub Desktop.
// 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