<div class="cart">
{{ form_start(form, { attr: { class: 'form-horizontal validation' }}) }}
{{ form_errors(form) }}
<table class="table table-hover table-borderless">
<thead>
<tr>
<th style="width: 150px;"></th>
<th>{{ 'cart.product'|trans({}, 'frontend') }}</th>
<th style="width: 15%;">{{ 'cart.amount'|trans({}, 'frontend') }}</th>
<th class="text-right">{{ 'cart.price'|trans({}, 'frontend') }}</th>
<th class="text-left">{{ 'cart.total'|trans({}, 'frontend') }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for child in form.items %}
{% include '@VisualMediaOrder/Cart/item.html.twig' with { form: child } only %}
{% else %}
<tr>
<td></td>
<td colspan="5">{{ 'cart.empty'|trans({}, 'frontend') }}</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if not cart.empty %}
<tr>
<th colspan="4" class="text-right">{{ 'cart.subtotal'|trans({}, 'frontend') }}</th>
<th class="text-left">€ {{ cart.subtotal|price_format }}</th>
</tr>
{% if cart.order is not null %}
{% if cart.order.discount is not null %}
<tr>
<th colspan="4" class="text-right">{{ 'cart.discount'|trans({}, 'frontend') }} <sup>({{ cart.order.discount.code }})</sup></th>
<th class="text-left">€ {{ cart.discountPrice|price_format }}</th>
</tr>
{% endif %}
{% endif %}
<tr>
<th colspan="4" class="text-right">{{ 'cart.shipping_costs'|trans({}, 'frontend') }}:</th>
<th class="text-left">
{% if cart.shippingCosts > 0 %}
€ {{ cart.shippingCosts|price_format }}
{% else %}
<span class="free">{{ 'cart.free'|trans({}, 'frontend') }}</span>
{% endif %}
</th>
<th></th>
</tr>
{% if cart.paymentCosts > 0 %}
<tr>
<th colspan="4" class="text-right">{{ 'cart.payment_costs'|trans({}, 'frontend') }}:</th>
<th class="text-left">
€ {{ cart.paymentCosts|price_format }}
</th>
<th></th>
</tr>
{% endif %}
<tr>
<th colspan="4" class="text-right">{{ 'cart.total'|trans({}, 'frontend') }}</th>
<th class="text-left">€ {{ cart.total|price_format }}</th>
<th></th>
</tr>
{% endif %}
</tfoot>
</table>
<div class="row">
<div class="col-12">
<a class="btn btn-primary" href="{{ path('home') }}">{{ 'cart.continue_shopping'|trans({}, 'frontend') }}</a>
{{ form_widget(form.submit, { attr: { class: 'btn btn-success float-right' }}) }}
</div>
</div>
{{ form_end(form) }}
</div>