Ecommerce thrives on seamless experiences. From browsing to checkout, every interaction shapes a customer’s perception of your store. One small yet impactful addition I recently worked on was helping a merchant add an action in WooCommerce to view and print order receipts directly from the order management page.
By default, WooCommerce doesn’t have a built-in way to print order receipts. The usual workaround is to use the browser’s print option or use an additional WooCommerce plugin. While this works, it isn’t always intuitive or convenient for store owners. So, when a customer reached out asking for a dedicated order action, I decided to craft a solution tailored to their needs.
The Request: A Click-to-Print Feature
The merchant wanted a dedicated button within the order actions dropdown that would allow them to view and print an order receipt quickly. They found navigating through WooCommerce’s default order screens a bit tedious when all they needed was a simple receipt.
I first explained that WooCommerce doesn’t have this feature natively. However, instead of stopping there, I saw an opportunity to add real value by creating a lightweight custom code snippet.
The Solution: A Simple Yet Effective Code Snippet
To fulfill their request, I wrote a small but powerful piece of code that adds a “View or Print Receipt” action to WooCommerce orders. Here’s how it works:
- Adds an order action named “View or Print Receipt.”
- Redirects the user to the order-received page (which serves as a receipt).
- Leverages WooCommerce’s built-in URL structure, ensuring compatibility with the store’s existing setup.
add_action( 'woocommerce_order_actions', function( $actions ) {
$actions['wc_view_receipt'] = 'View or Print Receipt';
return $actions;
} );
add_action( 'woocommerce_order_action_wc_view_receipt', function( $order ) {
$receipt_url = sprintf(
'%s/checkout/order-received/%d/?key=%s',
site_url(), $order->get_id(), $order->get_order_key()
);
wp_safe_redirect( $receipt_url );
exit;
} );
How It Works:
- The first function adds a new order action labeled “View or Print Receipt”.
- The second function redirects to the order receipt page, which includes all order details.
- Store owners can then simply use their browser’s print function (Ctrl + P / Command + P) to print the receipt.

Why This Matters
For store owners who process bulk orders daily, quickly accessing and printing receipts saves time and effort. Instead of navigating through multiple order screens, they can now click once and print immediately.
But beyond convenience, this solution exemplifies a core principle of effective eCommerce development: focusing on value rather than just features. Adding a print action isn’t just a functionality – it’s about making order management more intuitive and user-friendly.
Expanding the Feature
While this snippet solves the core issue, it can be further enhanced by:
- Customizing the receipt layout using a WooCommerce template override.
- Generating a PDF receipt instead of relying on the browser print function.
- Adding branding elements such as a company logo on the printed receipt.
For those looking to extend this further, plugins like WooCommerce Print Invoices & Packing Slips could also be explored, but this code snippet is a great lightweight alternative that doesn’t require any additional plugins.
Final Thoughts
Small improvements like this can have a big impact on store management efficiency. Whether you’re running a WooCommerce store or helping a merchant optimize theirs, keep in mind that the best solutions aren’t just about adding features – they’re about enhancing the experience.
So, if you ever find yourself needing to add a quick print option for WooCommerce orders, give this snippet a try. It’s a simple tweak that brings big value.
Have any WooCommerce challenges you’d like to solve? Let’s discuss and craft solutions that make your store management more efficient and enjoyable!
Leave a Reply