PDF Invoicing shortcode reference #
PDF Invoices & Packing Slips Generator for WooCommerce provides a large set of shortcodes to insert order, item, document, and refund data into your PDF templates. Use them in the HTML content, Header, Footer, and Number format fields of a document.
Note: each shortcode below uses single square brackets, for example [order_total]. If you set a Shortcode prefix in the general settings, add it to every tag (for example [pdf_order_total]).
Document shortcodes #
| Shortcode | Returns | Example |
|---|---|---|
[doc_nr] |
The document number, built from Number format. | Invoice No: [doc_nr] |
[doc_counter] |
The raw per-document counter value. | [doc_counter format="%06d"] |
[doc_formatted_date] |
The document creation date. | Date: [doc_formatted_date datetime_format="Y-m-d"] |
[doc_author_full_name] |
Full name of the user who created the document. | Issued by: [doc_author_full_name] |
Order shortcodes #
| Shortcode | Returns | Example |
|---|---|---|
[order_number] |
The WooCommerce order number. | Order: [order_number] |
[order_status] |
The current order status. | Status: [order_status] |
[order_formatted_billing_address] |
The formatted billing address. | [order_formatted_billing_address] |
[order_formatted_shipping_address] |
The formatted shipping address. | [order_formatted_shipping_address] |
[order_total] |
The order total. | Total: [order_total format="price"] |
[order_total_tax] |
The total tax amount. | Tax: [order_total_tax format="price"] |
[order_total_tax_percent] |
The overall tax percentage. | [order_total_tax_percent precision="0"]% |
[order_total_in_words] |
The order total spelled out in words. | [order_total_in_words lang="EN"] |
[order_payment_method_title] |
The payment method title. | Paid with: [order_payment_method_title] |
[order_meta key="..."] |
A single order meta value. | VAT ID: [order_meta key="_billing_eu_vat_number"] |
Many more order properties are available, including [order_subtotal], [order_total_excl_tax], [order_shipping_total], [order_shipping_method], [order_discount], [order_billing_first_name], [order_billing_last_name], [order_tax_totals], and refund totals. See the PDF Invoice Shortcode Attributes Reference for the full property list and the formatting attributes.
Item and refund shortcodes #
Item shortcodes only return a value inside an [each_item] loop, and refund shortcodes inside an [each_refund] loop (see Conditional Content in PDF Invoices).
| Shortcode | Returns |
|---|---|
[item_name] |
The line item name. |
[item_qty] |
The item quantity. |
[item_single] |
The single-unit price, excluding tax. |
[item_total] |
The line total, excluding tax. |
[item_total_tax] |
The line tax amount. |
[item_product_sku] |
The product SKU. |
[item_meta key="..."] |
A single order-item meta value. |
[refund_nr], [refund_total], [refund_reason] |
Refund number, total, and reason (inside [each_refund]). |
Layout and logic shortcodes #
[each_item]…[/each_item]: loops over order line items.[each_refund]…[/each_refund]: loops over order refunds.[if value1="..." operator="equal" value2="..."]…[/if]: conditional output.[translate lang="EN,DE"]…[/translate]: shows text only for the matching order language.[line],[break],[clear],[paragraph]…[/paragraph],[page_break]: layout helpers.[current_time datetime_format="Y-m-d"]: the current date/time.[checkbox]: a checkbox input for printed forms.
Need the full list? #
For every property, alias, and the formatting attributes (format, add, subtract, multiply, divide, find/replace, before/after), see the PDF Invoice Shortcode Attributes Reference. Need a hand? Our team answers every ticket on the PDF Invoicing support forum.