Add shipment method and price on the order detail


I want to add the shipment on the order detail twig template.
With the default order-detail.twig, it is not present (with Commerce v1.2.0-rc5), event if I’m calling the snippet like with [[!commerce.get_order? &loadShipments=1]]
I have personalized my order-detail.twig file like this :

        {% for shipment in data.shipments %}
                <td>{{ }}</td>
                <td class="align-right">{{ shipment.fee_ex_tax_formatted }}</td>
                <td class="align-right">{{ shipment.tax_amount_formatted }}</td>
                <td class="align-right">{{ shipment.fee_incl_tax_formatted }}</td>
        {% endfor %}
            <td colspan="2">&nbsp;</td>
            <th>{{ order.total_ex_tax_formatted }}</th>
            <th>{{ order.tax_formatted }}</th>
            <th>{{ order.total_formatted }}</th>

But the shipment line stay empty during the parsing.

Is it a bug ?
Did I miss something ?

Have you tried it like this?

{% for shipment in shipments %}
1 Like

It’s working well now :slight_smile:

1 Like