Most shortcodes in PDF Invoices & Packing Slips Generator for WooCommerce accept a common set of attributes for formatting, math, and text replacement. This reference lists those attributes, the footer placeholders, and the full property list. For the shortcodes themselves, see the Shortcode Reference.
Common formatting attributes #
These attributes work on any property shortcode (for example [order_total], [item_single], [doc_counter]).
| Attribute | Effect | Example |
|---|---|---|
format |
Formats the value. Use price for a WooCommerce price, or any sprintf pattern such as %06d or %.2f. |
[order_total format="price"] |
add |
Adds a number (or another shortcode value) to a numeric result. | [order_total_items_count add="1"] |
subtract |
Subtracts a number from a numeric result. | [order_total subtract="5"] |
multiply |
Multiplies a numeric result. | [item_total multiply="1.2"] |
divide |
Divides a numeric result (ignored if the divisor is 0). | [order_total divide="2"] |
find / replace |
Replaces text in the result. | [order_status find="wc-" replace=""] |
multiple_find / multiple_replace |
Comma-separated find/replace pairs applied together. | [order_status multiple_find="a,b" multiple_replace="x,y"] |
before / after |
Text added before/after the value, but only when the value is not empty. | [order_meta key="_vat" before="VAT: "] |
datetime_format |
PHP date format for date shortcodes. | [doc_formatted_date datetime_format="d/m/Y"] |
add_days |
Adds days to a document date (useful for due dates). | [doc_formatted_date add_days="14"] |
Tip: inside the add, subtract, multiply, and divide attributes you can nest another shortcode using curly braces, for example [order_total add="{order_total_tax}"]. The plugin converts { } to [ ] before evaluating.
Footer placeholders #
The Footer HTML content field supports two special placeholders that TCPDF fills at render time:
| Placeholder | Value |
|---|---|
%page_num% |
The current page number. |
%total_pages% |
The total number of pages. |
The default footer content is %page_num% / %total_pages%.
Property list #
Every property below can be written as its own shortcode, for example [order_total], or as [prop name="order_total"].
Document #
doc_nr, doc_counter, doc_formatted_date, doc_author_full_name
Order #
order_number, order_status, order_subtotal, order_subtotal_incl_tax, order_total, order_total_excl_tax, order_total_excl_shipping, order_total_excl_tax_excl_shipping, order_total_tax, order_total_tax_percent, order_total_in_words, order_tax_totals, order_discount, order_discount_incl_tax, order_discount_tax, order_discount_percent, order_shipping_total, order_shipping_total_incl_tax, order_shipping_total_excl_tax, order_shipping_method, order_payment_method_title, order_checkout_payment_url, order_formatted_billing_address, order_formatted_shipping_address, order_billing_first_name, order_billing_last_name, order_formatted_date_created, order_total_items_count, order_total_items_qty, order_meta, order_details_email, order_details_table, order_func, order_total_refunded, order_total_tax_refunded, order_total_shipping_refunded
Order item (inside [each_item]) #
item_nr, item_name, item_qty, item_total, item_total_tax, item_total_incl_tax, item_total_tax_percent, item_single, item_single_incl_tax, item_subtotal, item_subtotal_tax, item_discount, item_discount_incl_tax, item_discount_tax, item_discount_percent, item_meta, item_func, item_product_id, item_product_sku, item_product_image, item_product_taxonomy, item_product_meta, item_product_func
Refund (inside [each_refund]) #
refund_nr, refund_total, refund_reason
Need a hand? #
For help building a specific number format or template, contact us on the PDF Invoicing support forum.