Available Variables for Magento PDF Layouts

Chris / last updated on November 7, 2023

With my Advanced Invoice Layout Extension you have lots of possibilities for dynamic content in your Magento PDF layouts.

For salutations, footer columns and other free texts in the Magento PDF invoices, shipments and creditmemos, the following variables are available in System › Configuration › Advanced Invoice Layout.

Please note: Simple existence of a variable can be checked with {{depend shipping_date}}, negations can be used with {{if is_shipment}}{{else}}No Shipment{{/if}}.

{{var increment_id}}Invoice/Shipment/Creditmemo Increment Id
{{var customer_id}}Customer Id
{{var order.getIncrementId()}}Order Id (all other order attributes can also be accessed with the order object)
{{var increment_id}}Invoice/Shipment/Creditmemo Increment Id
{{depend is_invoice}}
Text only for invoices
"Text only for invoices" will only be shown on invoice PDFs.
{{depend is_shipment}}
Text only for shipments
"Text only for shipments" will only be shown on shipment PDFs.
{{depend is_creditmemo}}
Text only for creditmemos
"Text only for creditmemos" will only be shown on creditmemo PDFs.
{{var billing_address}}Billing Address of Order (formatting can be configured)
{{var shipping_address}}Shipping Address of Order (formatting can be configured)
{{date}}Date of invoice/shipment/creditmemo creation (formatted in your locale)
{{date+X}}Date of invoice/shipment/creditmemo creation plus specified number of days, e.g. for specifying due/delivery dates.
(Replace "X" with number of days)
{{var prefix}}Customer Prefix
{{var firstname}}Customer Firstname
{{var lastname}}Customer Lastname
{{var shipping_date}}The date of the first shipment (if any)
{{var payment_method.getTitle()}}The payment method title
{{if payment_method_purchaseorder}}
Only for invoices with payment method purchase order.
{{else}}For all other payment methods.{{/if}}
With this statement you can insert text that is dependent on the payment method, in this example purchaseorder. Just replace the text "purchaseorder" with your payment method code, e.g. "checkmo", "banktransfer", "payone", ..
{{config path="design/head/default_description"}}Access any Magento configuration value. Please note that the variable has to be allowed in System › Permissions › Variables
{{customVar code=test_variable}}Any Magento variable configured in System › Custom Variables

If you have the extension Firegento_MageSetup installed the following additional variables are available:
{{config path="general/imprint/tax_number"}}The configured tax number of the merchant
{{config path="general/imprint/vat_id"}}The configured vat number of the merchant
{{config path="general/imprint/bank_account"}}The configured bank account
{{config path="general/imprint/bank_code_number"}}The configured bank code number
{{config path="general/imprint/bank_name"}}The configured bank name
{{config path="general/imprint/swift"}}The configured swift number
{{config path="general/imprint/iban"}}The configured iban number

« Back to the FAQ overview