Woocommerce receipt template

Woocommerce receipt template

Modify the Default Receipt Layout

Adjusting the standard WooCommerce receipt template requires modifying the template files or using hooks. The key file for customization is email-order-details.php, located in the WooCommerce plugin directory. To make changes:

  1. Copy woocommerce/templates/emails/email-order-details.php to your theme folder under yourtheme/woocommerce/emails/.
  2. Edit the copied file to include additional order details, adjust formatting, or add branding elements.
  3. Save changes and test by generating a new order receipt.

Use Hooks for Dynamic Content

woocommerce receipt template

For those who prefer adding custom elements without modifying template files, WooCommerce provides hooks. Here are useful ones:

  • woocommerce_email_before_order_table – Insert content before the order summary.
  • woocommerce_email_after_order_table – Add extra details below the order summary.
  • woocommerce_email_order_meta – Include metadata such as custom fields or tracking numbers.

Example Hook Implementation

To insert a custom message above the order details, add this snippet to your theme’s functions.php file:


add_action('woocommerce_email_before_order_table', function ($order, $sent_to_admin, $plain_text, $email) {
echo '

Thank you for your purchase! Here’s your receipt:

'; }, 10, 4);

Enhancing the Receipt with Plugins

Plugins simplify customization by offering drag-and-drop editors and additional features. Popular choices include:

  • WooCommerce PDF Invoices & Packing Slips – Generates receipts in PDF format.
  • YITH WooCommerce Email Templates – Provides pre-designed templates for styling order emails.

Using these tools, you can refine your receipts without touching the code while ensuring a polished and branded customer experience.

WooCommerce Receipt Template: Customization and Enhancement
Tweaking Default WooCommerce Receipt Design
Inserting Custom Fields into the Receipt Layout
Adjusting Fonts, Colors, and Brand Elements
Incorporating Order Meta Data into the Receipt
Creating PDF Receipts for Customers
Integrating Third-Party Plugins for Extended Features

Modifying the Default WooCommerce Receipt

woocommerce receipt template

Customize the standard receipt by modifying the template file located in woocommerce/templates/emails/email-order-details.php. Copy this file to your theme’s folder under woocommerce/emails/ and adjust the layout to match your brand’s style. Remove unnecessary elements, restructure sections, or add new fields using WooCommerce hooks.

Adding Custom Fields and Styling

woocommerce receipt template

To include custom checkout fields, use the woocommerce_email_order_meta hook. Retrieve and display additional data such as tax numbers, delivery instructions, or custom discount codes. Example:


add_action('woocommerce_email_order_meta', 'custom_email_order_meta', 10, 3);
function custom_email_order_meta($order, $sent_to_admin, $plain_text) {
echo '

Customer Note: ' . esc_html($order->get_customer_note()) . '

'; }

Adjust fonts, colors, and branding elements by adding custom CSS to your theme’s style.css or using the wp_enqueue_style function in functions.php. Inline styles in the email template also work but may be limited by email clients.

Generating PDF Receipts

Use plugins like WooCommerce PDF Invoices & Packing Slips to convert receipts into PDFs. If you prefer a custom solution, integrate dompdf or TCPDF and generate PDFs dynamically using order data. Store the files for customer downloads or email attachments.

Enhancing the WooCommerce receipt boosts user experience and strengthens brand identity. Whether adjusting the layout, adding data fields, or generating PDFs, these improvements create a more professional and informative document for customers.

Related Templates