{% load theme_builder_design theme_builder_context ecommerce_blocks shop_texts %}{% comment %}Story 17.8 — closed purchase block copied from product_detail.html; csrf comes from tb_render (`only`); fixed ids stay off the block_wrapper_attrs element.{% endcomment %} {% check_block_has_context bloc tb_render as has_context %}{% if has_context %}{% get_shop_block_options bloc as options %}{% with page_context=tb_render.page_context request=tb_render.page_context.requete %} {% with produit=page_context.produit selecteur=page_context.selecteur form=page_context.formulaire_ajout stock_label=page_context.etiquette_stock price_label=page_context.prix_texte shop_settings=page_context.reglages_boutique %} {% if price_label or selecteur or page_context.achat_possible %}
{% if price_label or selecteur %}

{{ price_label }}

{% endif %} {% if page_context.achat_possible %} {% comment %}Variant pages: the stock line and the buy block follow the picked variant (product-variants.js), so both always exist.{% endcomment %}

{% if stock_label %}{{ stock_label }}{% else %}{% shop_text "product_in_stock" %}{% endif %}

{% if selecteur %}{% include "ecommerce/_variant_selector.html" with variant_selector=selecteur is_sold_out_hidden=page_context.masquer_declinaisons_epuisees sold_out_text=page_context.texte_declinaison_epuisee missing_text=page_context.texte_declinaison_manquante variant_script_data=page_context.donnees_script_declinaisons request=request %}{% endif %} {% if form %}
{% comment %}Drawer mode (Story 3.11): HTMX answers in the drawer, or next to the button when it doesn't open by itself; action stays the no-JS fallback.{% endcomment %}
{% if selecteur %}{% endif %} {% with field=form.quantity %} {% if field.is_hidden %} {{ field }} {% else %} {{ field }} {% endif %} {% endwith %}
{% if shop_settings.basket_display_mode == "drawer" %}
{% endif %} {% if options.show_basket_link %}Voir le panier{% endif %} {% if options.show_reassurance %}
  • {% shop_text "product_reassurance_payment" %}
  • {% shop_text "product_reassurance_shipping" %}
  • {% shop_text "product_reassurance_returns" %}
{% endif %}
{% endif %} {% endif %}
{% if form and options.show_sticky_bar %} {% comment %}Mobile only; submits the form above through form="…" instead of duplicating it.{% endcomment %}
{% if price_label %} {{ price_label }} {% endif %}
{% endif %}
{% endif %} {% endwith %}{% endwith %}{% endif %}