주 콘텐츠로 건너뛰기
버전: 1.x

Receipts on Your Online Store

Your WCPOS receipt templates aren't limited to the till. Online-store customers can view and download their order receipt or invoice from My Account or the order confirmation page, rendered with a custom template from WP Admin → POS → Templates.

Requires WCPOS 1.9.11

Storefront receipt access ships with WCPOS 1.9.11. Earlier versions only render receipts inside the POS.

This page is about customers downloading their own receipts

Cashiers and staff don't need any of this — the POS Orders screen already lists every WooCommerce order, including online orders, and can view, print, or email its receipt from the three-dot menu. This page covers the other direction: letting customers download the receipt themselves from your website.

My Account download button

As soon as a receipt template is Active, logged-in customers see a Receipt button next to eligible orders in My Account → Orders. Clicking it downloads a PDF (receipt-1234.pdf) rendered with the storefront's default receipt template.

By default the button appears for Processing, Completed, and Refunded orders — statuses where the order has been paid. Pending, cancelled, and failed orders don't show it.

There's nothing to configure: activate a template and the button is live. If you'd rather not show it, a developer can turn it off with a filter.

The [wcpos_receipt] shortcode

To add a receipt link to the order confirmation ("thank you") page or the My Account → view order page, use:

[wcpos_receipt]

With no attributes, the shortcode detects the current order automatically on either page and renders a Download receipt (PDF) link. On other pages it outputs nothing. An explicit order_id only works for a logged-in customer who owns that order.

Attributes

AttributeDefaultWhat it does
order_id(auto-detected)Link to a specific order. Only works for logged-in customers who own the order.
link_textDownload receipt (PDF)The link text.
formatpdfpdf downloads a PDF; html opens the printable receipt view instead.
template(storefront default)Render with a specific template ID instead of the storefront default.
classwcpos-receipt-linkCSS class for the link.
id(none)HTML id for the link.

Examples

A download link on the order confirmation page:

[wcpos_receipt link_text="Download your invoice"]

A link to the on-screen (printable) receipt rather than a PDF:

[wcpos_receipt format="html" link_text="View your receipt"]

Render with a specific template — for example an A4 invoice template instead of your 80mm till receipt:

[wcpos_receipt template="123" link_text="Download invoice (PDF)"]

The template ID is the number in the template's edit-screen URL (post=123) in WP Admin → POS → Templates.

Which template do customers get?

Storefront downloads use the configured receipt template, or the first active template when none is configured. This storefront default is independent of the template a cashier selects from the till dropdown. If the storefront default is a narrow thermal-style receipt, the PDF will be narrow too.

For online orders you may prefer a full-page document. Two options:

  • Use a full-page template as the storefront default (the gallery's Invoice template is designed for A4/Letter), or
  • Keep your till templates active and point the storefront at a different template using the shortcode's template attribute, or site-wide with the developer filter below.

Templates render from the same receipt data payload as the POS, so your logo, store identity, tax settings, and customisations all carry over.

Security

Receipt links carry the order's unique key — the same mechanism WooCommerce uses for its order confirmation pages — so guests who checked out without an account can still use the link from the confirmation page. Anyone without the link needs to be logged in as the order's customer. Explicit order_id shortcodes only render for the logged-in owner of that order.

Pretty permalinks required

Like all WCPOS checkout pages, the receipt URL uses WordPress rewrite rules. Sites using Plain permalinks (Settings → Permalinks) need to switch to any other permalink structure.

For developers

Three filters control the storefront surfaces:

// Hide the My Account Receipt button.
add_filter( 'woocommerce_pos_storefront_receipt_my_account_button', '__return_false' );

// Change which order statuses show the button (default: processing, completed, refunded).
add_filter( 'woocommerce_pos_storefront_receipt_order_statuses', function ( $statuses, $order ) {
$statuses[] = 'on-hold';
return $statuses;
}, 10, 2 );

// Use a different template for storefront PDF downloads only.
// Receives and returns the full template array (null when none is configured).
add_filter( 'woocommerce_pos_storefront_receipt_template', function ( $template, $order ) {
return \WCPOS\WooCommercePOS\Templates::get_template( 123 );
}, 10, 2 );

The PDF route itself is /wcpos-checkout/wcpos-receipt/{order_id}?key={order_key}&format=pdf — the same order-key-gated endpoint the POS uses for receipts, with format=pdf returning the rendered PDF instead of the on-screen view.