Created
January 22, 2022 20:05
-
-
Save cesgarma/d1f8a73851bec536816699d3c0ac846a to your computer and use it in GitHub Desktop.
Preview woocommerce thank you page for an order in the Woocommerce order view
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
<?php | |
/** | |
* Add a button to the order admin panel below the order details that opens the thank you page for that order. | |
*/ | |
function action_woocommerce_admin_order_data_after_order_details( $order ) { | |
echo '<a href="' . $order->get_checkout_order_received_url() . '" target="_blank" class="button" style="margin-top:10px">' . __( 'Preview Thank you page', 'woocommerce' ) . '</a>'; | |
} | |
add_action( 'woocommerce_admin_order_data_after_order_details', 'action_woocommerce_admin_order_data_after_order_details', 10, 1 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment