{% load shop_texts %} {% comment %} Basket lines and total (Story 3.6). Plain HTML form, works without JavaScript (AD-22): each "Retirer" button submits its own line's DELETE flag; quantity 0 removes a line too. {% endcomment %} {% if line_list %}
{% csrf_token %} {% comment %}First submit button = the one Enter triggers: must update, never a line's "Retirer".{% endcomment %} {{ formset.management_form }} {% if checkout_block_reason == "lines" %}

{% shop_text "basket_blocked" %}

{% elif checkout_block_reason == "payment" %}

{% shop_text "checkout_no_payment_method" %}

{% endif %} {% for row in line_list %} {% with form=row.form line=row.line product=row.line.product %} {% endwith %} {% endfor %}
Article Prix unitaire Quantité Sous-total Actions
{% with image=product.images.first %} {% if image %}{% endif %} {% endwith %} {{ form.id }} {% if product.is_public %} {{ product.get_title }} {% else %} {{ product.get_title }} {% endif %} {% if row.unavailable_reason %}

{{ row.unavailable_reason }}

{% endif %} {% for error in form.non_field_errors %}

{{ error }}

{% endfor %}
{% if line.unit_price_incl_tax is not None %}{{ line.unit_price_incl_tax|floatformat:2 }} €{% else %}—{% endif %} {% if form.quantity.is_hidden %} {{ form.quantity }}{{ line.quantity }} {% else %} {{ form.quantity }} {% endif %} {% for error in form.quantity.errors %}

{{ error }}

{% endfor %}
{% if line.line_price_incl_tax is not None %}{{ line.line_price_incl_tax|floatformat:2 }} €{% else %}—{% endif %}
{% else %}

{% shop_text "basket_empty" %}

Découvrir la boutique {% endif %}