### Display Order Totals and Shipping in Email Template Source: https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQE12fDr1F10vsY0N7moPHkgipyHKsPcFMgErPrfr_1H5_4gWDfJQuCiAwl26r3W5NRXhVSHEzFPtRjpRlS8XtubE6gfmjGbVI6npg9H-gbvjmJHWIMiOWF5NKaIePI-_IqpD6M7wQh_ZfEcuA663H95LQ9Z8DdxXLNcZNB-Xrux This snippet displays shipping costs, net and gross total costs, and tax information. It also shows the chosen shipping method and its description. ```twig {% set delivery = order.deliveries.first %}
Shipping costs: {{order.deliveries.first.shippingCosts.totalPrice|currency(currencyIsoCode) }}
Total costs net: {{ order.amountNet|currency(currencyIsoCode) }}
{% for calculatedTax in order.price.calculatedTaxes %}
{% if order.taxStatus is same as('net') %}zzgl.{% else %}inkl.{% endif %} {{ calculatedTax.taxRate }}% MwSt. {{ calculatedTax.tax|currency(currencyIsoCode) }}
{% endfor %}
Total costs gross: {{ order.amountTotal|currency(currencyIsoCode) }}
Chosen shipping method: {{ delivery.shippingMethod.name }}
{{ delivery.shippingMethod.description }}
```
--------------------------------
### Display Order Details in Email Template
Source: https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQE12fDr1F10vsY0N7moPHkgipyHKsPcFMgErPrfr_1H5_4gWDfJQuCiAwl26r3W5NRXhVSHEzFPtRjpRlS8XtubE6gfmjGbVI6npg9H-gbvjmJHWIMiOWF5NKaIePI-_IqpD6M7wQh_ZfEcuA663H95LQ9Z8DdxXLNcZNB-Xrux
This snippet shows how to display basic order information like order number and date, and generate a deep link for order status tracking. It uses Twig variables and the rawUrl function.
```twig
Hello {{order.orderCustomer.salutation.letterName }} {{order.orderCustomer.firstName}} {{order.orderCustomer.lastName}},
We received your order on {{ order.orderDateTime|date }}.
Order number: {{ order.orderNumber }}
As soon as payment is received, you will receive a separate notification and your order will be processed.
You can check the current status of your order at any time using this link: {{ rawUrl('frontend.account.order.single.page', { 'deepLinkCode': order.deepLinkCode}, salesChannel.domains|first.url) }}
. You can also use this link to edit the order, change the payment method or make a payment afterwards.
Information on your order:
```
--------------------------------
### Render Order Line Items in Email Template
Source: https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUZIYQE12fDr1F10vsY0N7moPHkgipyHKsPcFMgErPrfr_1H5_4gWDfJQuCiAwl26r3W5NRXhVSHEzFPtRjpRlS8XtubE6gfmjGbVI6npg9H-gbvjmJHWIMiOWF5NKaIePI-_IqpD6M7wQh_ZfEcuA663H95LQ9Z8DdxXLNcZNB-Xrux
This snippet iterates through order line items to display product details, quantity, and pricing. It includes logic to show product options and different payload types like text fields or images.
```twig
| Pos. | Bezeichnung | Menge | Preis | Summe |
| {{ loop.index }} |
{{ lineItem.label|u.wordwrap(80) }} {% if lineItem.payload.options is defined and lineItem.payload.options|length >= 1 %} {% for option in lineItem.payload.options %} {{ option.group }}: {{ option.option }} {% if lineItem.payload.options|last != option %} {{ " | " }} {% endif %} {% endfor %} {% endif %} {% if lineItem.payload.type is defined %} {% if lineItem.payload.type == "textfield" %} {{ lineItem.payload.value }} {% elseif lineItem.payload.type == "textarea" %} {{ lineItem.payload.value }} {% elseif lineItem.payload.type == "numberfield" %} {{ lineItem.payload.value }} {% elseif lineItem.payload.type == "datetime" %} {{ lineItem.payload.value|date("Y.m.d") }} {% elseif lineItem.payload.type == "timestamp" %} {{ lineItem.payload.value|date("H:i:s") }} {% elseif lineItem.payload.type == "htmleditor" %} {{ lineItem.payload.value }} {% elseif lineItem.payload.type == "imageupload" %} {% for media in lineItem.payload.media %} {{ media.filename }} {% endfor %} {% elseif lineItem.payload.type == "fileupload" %} {% for media in lineItem.payload.media %} {{ media.filename }} {% endfor %} {% endif %} {% endif %} {% if lineItem.payload.productNumber is defined %}Artikel-Nr: {{ lineItem.payload.productNumber|slice(0,9) }}{% endif %} |
{{ lineItem.quantity }} | {{ lineItem.unitPrice|currency(currencyIsoCode) }} | {{ lineItem.totalPrice|currency(currencyIsoCode) }} |
| Pos. | Bezeichnung | Menge | Preis | Summe |
| {{ loop.index }} |
{{ lineItem.label|u.wordwrap(80) }} {% if lineItem.payload.options is defined and lineItem.payload.options|length >= 1 %} {% for option in lineItem.payload.options %} {{ option.group }}: {{ option.option }} {% if lineItem.payload.options|last != option %} {{ " | " }} {% endif %} {% endfor %} {% endif %} {% if lineItem.payload.productNumber is defined %}Artikel-Nr: {{ lineItem.payload.productNumber|u.wordwrap(80) }}{% endif %} |
{{ lineItem.quantity }} | {{ lineItem.unitPrice|currency(currencyIsoCode) }} | {{ lineItem.totalPrice|currency(currencyIsoCode) }} |