Managing WooCommerce orders can sometimes be tedious, especially when you frequently need to revisit the order confirmation (Thank You) page for specific orders. Manually retrieving the order_key and constructing URLs every time is inefficient. Fortunately, there is a much simpler solution to streamline this workflow.
Why revisit the Thank You page?
There are multiple reasons you might want to access an order confirmation page directly from the WooCommerce admin:
- Confirming the appearance and content of the Thank You page
- Quickly verifying order details presented to the customer
- Troubleshooting issues reported by customers
Solution
Here’s a straightforward approach using WooCommerce filters and actions that automatically creates an admin link to revisit the order confirmation page directly from the WooCommerce Orders admin screen. Copy and add this code to your child-theme’s functions.php file or a site-specific plugin. To maintain best practices and avoid conflicts, all functions are prefixed with gq_.
/**
* Adds an action button in WooCommerce admin order list to quickly access the thank-you page.
*
* @param array $actions Current actions available for the order.
* @param WC_Order $order WooCommerce order object.
*
* @return array Modified actions array including the new action.
*/
function gq_order_confirmation_action_button( $actions, $order ) {
if ( $order->has_status( wc_get_is_paid_statuses() ) ) {
$order_confirmation_url = add_query_arg( 'customer_view', $order->get_customer_id(), $order->get_checkout_order_received_url() );
$actions['order_confirmation'] = array(
'url' => $order_confirmation_url,
'name' => __( 'View Order Confirmation', 'woocommerce' ),
'action' => "view manage_order",
);
}
return $actions;
}
add_filter( 'woocommerce_admin_order_actions', 'gq_order_confirmation_action_button', 100, 2 );
/**
* Overrides the current user ID to enable viewing of the order confirmation page from admin.
*
* @param int $customer_id Original customer ID.
*
* @return int Modified customer ID based on the 'customer_view' URL parameter.
*/
function gq_short_circuit_current_user( $customer_id ) {
if ( ! empty( $_GET['customer_view'] ) ) {
$customer_id = wc_clean( wp_unslash( $_GET['customer_view'] ) );
}
return $customer_id;
}
add_filter( 'determine_current_user', 'gq_short_circuit_current_user' );
// Disable WooCommerce shopper verification for easier admin access
add_filter( 'woocommerce_order_received_verify_known_shoppers', '__return_false' );How Does It Work?
- Admin Action Button: The first function (
gq_order_confirmation_action_button) creates a convenient “View Order Confirmation” button on the WooCommerce Orders admin page, linking directly to the customer’s Thank You page. - Customer Context Handling: The second function (
gq_short_circuit_current_user) ensures the admin can view the order confirmation page exactly as the customer sees it, bypassing typical WooCommerce login checks. - Bypass Shopper Verification: Disabling shopper verification allows direct access without logging out from admin.
Benefits of This Approach
- Saves considerable time managing WooCommerce orders
- Simplifies troubleshooting customer order issues
- Improves customer service by quickly accessing and verifying order confirmation pages
777lococasino looks kinda wild! Anyone actually played there? Let me know if 777lococasino is worth a shot.
Took a gander at 8okvip.info. It’s fairly pleasant. Check it out! Let me know what you think about 8okvip. Its something special.
I’ve heard whispers about happylukelink. Looks like a decent option if you’re looking for some online fun. Give it a try at happylukelink
S9gameapk is really useful for finding game APKs. It worked out pretty well for me. I like it! See for yourself: s9gameapk
doxycycline for pneumonia
doxycycline for pneumonia
Looking at this platform’s secure setup and vast game library, I trust the verified Aaajili Login app download apk link for safe mobile access today. Always prioritize licensed sites to ensure your funds stay protected while enjoying these immersive slots responsibly.
I was pleasantly surprised by this platform’s smooth performance; unlike others, GBets Login App delivers a seamless experience you can explore right here via gbets login app com.
Bajilive365login made getting into my account super easy. The login process is straightforward and quick. Happy with the convenience. bajilive365login
If you’re looking for a solid ‘nuôi lô 88.com’ resource, Lonuoirongbachkim is it. Seriously, I’ve seen some great results using their tips. Give it a try nuôi lô 88.com.
Yo, BYU 777 Casino is where it’s at! Great selection of games and the payouts are decent. Definitely worth a look-see byu 777 casino!
The color psychology here is genius for focus; try the okebet9 com login download apk to see how gradients guide your eye toward high-RTP games instantly.
kamagra gel upotreba
kamagra gel upotreba
Just spent a few hours on 888newxyz. Pretty slick website. Navigation is easy and the games are fun. I’d recommend it for a go! 888newxyz.
Yo, stumbled upon svplay388link the other day. It’s not bad, got some unique stuff there. Worth a peek if you’re bored! svplay388link.
Heard some buzz about vuabet88online so I checked it out. Seems alright, especially if you’re into online stuff. Take a look for yourself! vuabet88online.
vidalista 10mg reviews
vidalista 10mg reviews
Downloaded the 92betapp, and it’s smooth as butter. Easy to bet on the go. Thumbs up from me! Download it here: 92betapp
Yo, I’m looking at 100vipus right now. Heard it has fantastic user support. Give it a look, and tell me your opinions: 100vipus
King98bet popped up on my feed. Gonna do some digging and see if it is all the hype. Will probably put it out if it’s alright. Give it a try here: king98bet
Just found this gem between classes! Tong-its legit stats are insane with 96.2% RTP. Check out Tong-its slot download for the real deal before you lose track of time.
tadalafil premature ejaculation
tadalafil premature ejaculation
Selcuksports giriş is pretty straightforward. Didn’t have any problems getting in and watching the games selcuksports giriş.
Hey, has anyone tried Nora Bahis? I’m always looking for new platforms to place a few bets. Curious about the odds and user experience. Let me know what your experience with Nora Bahis is: nora bahis
Downloaded the onexbet app the other day, and it’s a game-changer. Betting on the go is super convenient. Get yours here: onexbet app
tadalafil tablets vidalista 80
tadalafil tablets vidalista 80
Alright, gotta get that B29 APK sorted! Makes gaming on the go so much easier. Anyone got pro tips for getting it installed smoothly? Check it out here: b29 apk
Feeling like a VIP? 777kingvip might be your spot. Tried it out and it’s alright. Become VIP at 777kingvip.
Heard some good things about aog777apps. Going to give it a shot tonight. Hopefully, it lives up to the hype! Find the app for yourself at: aog777apps
viagra off label
viagra off label
viagra pill sizes
viagra pill sizes
avanafil stendra
avanafil stendra
mezzion pharma udenafil
mezzion pharma udenafil