Add shipment method and price on the order detail

Hi,

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 :

        <tfoot>
        {% for shipment in data.shipments %}
            <tr>
                <td></td>
                <td>{{ shipment.method.name }}</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>
            </tr>
        {% endfor %}
        <tr>
            <td colspan="2">&nbsp;</td>
            <th>{{ order.total_ex_tax_formatted }}</th>
            <th>{{ order.tax_formatted }}</th>
            <th>{{ order.total_formatted }}</th>
        </tr>
        </tfoot>

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:
Thanks

1 Like