For the complete documentation index, see llms.txt. This page is also available as Markdown.

Twig variables & examples

In the Twig editors (line items table and summary) the usual variables of the Shopware document templates are available. This page summarizes the most important ones.

Availability per editor

Variable
Line items table
Summary

order

lineItems

– (via loop)

lineItem

✅ (per position)

config

hueRenderPhase

currencyIsoCode

set it yourself

languageId

billingAddress

The summary is rendered server-side and only receives order and lineItems. Set helper variables such as currencyIsoCode yourself there, e.g. {% set currencyIsoCode = order.currency.isoCode %}.

Order (order)

Expression
Description

order.orderNumber

Order number

order.amountNet

Net total of the order

order.amountTotal

Gross total of the order

order.price.totalPrice

Grand total

order.price.rawTotal

Raw total (before rounding)

order.price.calculatedTaxes.sortByTax

Taxes, sorted by tax rate

order.price.taxStatus

gross or net

order.shippingTotal

Shipping costs

order.currency.isoCode

Currency ISO code (e.g. EUR)

order.deliveries.first.shippingMethod.translated.name

Name of the shipping method

order.deliveries.first.getShippingOrderAddress

Delivery address

order.totalRounding, order.itemRounding

Rounding settings

Position (lineItem)

Expression
Description

lineItem.label

Label

lineItem.quantity

Quantity

lineItem.unitPrice

Unit price

lineItem.totalPrice

Total price of the position

lineItem.payload.productNumber

Product number

lineItem.payload.options

Variant options (group / option)

lineItem.payload.features

Product features (e.g. reference price)

lineItem.price.taxRules

Tax rates of the position

Configuration (config)

Expression
Description

config.displayLineItems

Display positions?

config.displayPrices

Display prices?

config.displayLineItemPosition

Display position number?

config.displayAdditionalNoteDelivery

Additional delivery note

config.deliveryCountries

Delivery countries (IDs)

config.fileType

File type of the rendered document

Useful filters

Filter
Description

`{{ value

currency(currencyIsoCode, languageId) }}`

`{{ value

sw_sanitize }}`

`{{ 'snippet.key'

trans }}`

Example: output the variant options of a position

Example: output the tax rates of a position

Tip: Since the bundled default templates match Shopware's standard layout exactly, they are the best reference for available variables and their usage. Load the default template and work your way forward from there.

Zuletzt aktualisiert