{% load shop_images shop_texts shop_variants %} {% 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 == "shipping" %}

{% shop_text "checkout_no_shipping" %}

{% 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 %} {% shop_line_product product as item %} {% endwith %} {% endfor %}
Article Prix unitaire Quantité Sous-total Actions
{% shop_product_image item.image item.image_product "basket" is_decorative=True show_placeholder=False %} {{ form.id }} {% if item.is_linkable %} {{ item.title }} {% else %} {{ item.title }} {% endif %} {% if item.label %}

{{ item.label }}

{% 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 %}
{% if can_checkout %} {% endif %}
{% else %}

{% shop_text "basket_empty" %}

Découvrir la boutique {% endif %}