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

Calculation summary

The field "Twig template for the summary" (card "Order items") controls the totals block displayed below the line items table – i.e. net total, taxes and grand total.

If a template is provided, it replaces Shopware's standard totals block. If the field is left empty, the standard block is used.

Special feature: server-side rendering

Unlike the line items table, this template is pre-rendered server-side (StringTemplateRenderer) and then inserted into the document. The following variables are available:

Variable
Description

order

The complete order object

lineItems

The line items of the order

Example (shortened)

{% set currencyIsoCode = order.currency.isoCode %}
{% set shippingAddress = order.deliveries.first.getShippingOrderAddress %}

<div class="sum-container">
    <table class="sum-table">
        <tr>
            <td class="align-right">Total (net):</td>
            <td class="align-right">{{ order.amountNet|currency(currencyIsoCode) }}</td>
        </tr>

        {% for calculatedTax in order.price.calculatedTaxes.sortByTax %}
            <tr>
                <td class="align-right">plus {{ calculatedTax.taxRate }}% VAT:</td>
                <td class="align-right">{{ calculatedTax.tax|currency(currencyIsoCode) }}</td>
            </tr>
        {% endfor %}

        <tr class="bold">
            <td class="align-right">Grand total:</td>
            <td class="align-right">{{ order.price.totalPrice|currency(currencyIsoCode) }}</td>
        </tr>
    </table>
</div>

Rounded grand total

The bundled default template also takes the order's rounding settings into account and displays both the raw and the rounded grand total if needed:

Loading the default template

Using the Load default template button below the editor you restore the bundled default template (matching the currently selected language). The full template for copying can be found under Template samples.

Note: For the delivery note, loading the default template intentionally sets an empty template, since delivery notes usually do not contain price totals.

Zuletzt aktualisiert