<div id="headBasket" class="flexJustify flexMiddle flexNoWrap">
<h3 class=" titlePannel">Mon panier</h3>
<a href="javascript:toggleBasketPanel();" id="closeBasketPanel" class="aTxtHide"></a>
</div>
{% set prodCold = false %}
{% for panier in basket %}
{% if panier.referenceObject.getId() is defined %}
<div id="articlePanier-{{ panier.referenceObject.getId() }}"
class="d-flex justify-content-center flex-nowrap {% if panier.discount_amount_unitary is defined %} discount{% endif %}">
{# <figure class="{% if panier.productObject.getProdCold() %} prodCold {% endif %}"> #}
{# {% set mediaTmp = panier.productObject.getProdPicture() %} #}
{# {% set mediaDefault = "default.jpg" %} #}
{# {% set mediaTmp = webp(webpSupported, mediaTmp) %} #}
{# {% set mediaDefault = webp(webpSupported, mediaDefault) %} #}
{# <img class="imgZoom" #}
{# src="{{ asset('/medias_front/products/' ~ mediaTmp|default(mediaDefault)) | imagine_filter('front_basket') }}" #}
{# alt="{{ panier.productObject.getProdModel() }}"> #}
{# </figure> #}
<div class="txtProd">
<div class="row">
<a class="nomProd"
href='{{ path('front_shopping_fiche', {product_name:panier.productObject.getProdModel()|urlrewrite, prod_id:panier.productObject.getId() }) }}'>
{{ panier.productObject.getProdModel() }}
{% if panier.productObject.getProdType() == 'multiple' %}
,{{ panier.referenceObject.getRefEntitled() }}
{% endif %}
</a>
<div class="">
{% if panier.discount_amount_unitary is defined %}
<span class="prixProd"><!--prix unitaire :-->{{ panier.discount_amount_unitary|number_format(2, '.', ',') }} €</span>
{% else %}
{% if panier.referenceObject.getRefSellingPrice() > panier.referenceObject.getRefReferencePrice() %}
<span class="prixProd bare rightPanel"><!--prix baré :-->{{ panier.referenceObject.getRefSellingPrice()|number_format(2, '.', ',') }} €</span>
{% endif %}
<span class="prixProd rightPanel"><!--prix unitaire :-->{{ panier.referenceObject.getRefReferencePrice()|number_format(2, '.', ',') }} €</span>
{% endif %}
</div>
</div>
<div id="gestion-qte-{{ panier.referenceObject.getId() }}" class="flexLeft flexMiddle flexNoWrap">
<div class="flexColumn">
<div class="m-0 row d-flex align-items-center ">
<span class="qte col-2">Qté :</span>
<div class="col-3 d-flex justify-content-start qteBasket">
{% set fromPage = fromBasket|default('') %}
{% if app.request.attributes.get('_route') == 'basket_index' %}
{% set fromPage = "panier" %}
{% elseif app.request.attributes.get('_route') == 'basket_delivery' %}
{% set fromPage = "delivery" %}
{% elseif app.request.attributes.get('_route') == 'basket_payment' %}
{% set fromPage = "payment" %}
{% endif %}
{% if panier.referenceObject.typeOdyssee != 'soin' and panier.referenceObject.typeOdyssee != 'bkdovalue' and (panier.referenceObject.getRefQuantity is null or panier.referenceObject.getRefQuantity > panier.qte or (panier.referenceObject.stockAlert < 0 and not stockManagement)) %}
<a class="cmdNbBasket moins" {% if panier.qte != 1 %} href="javascript:updateQteBasket({{ panier.referenceObject.getId() }}, 'less', '{{ fromPage }}' );"{% endif %}>{% if panier.qte > 1 %}-{% endif %}</a>
{% endif %}
<form id="formQte{{ panier.referenceObject.getId() }}" method="post" action="">
{% if panier.referenceObject.getRefQuantity < panier.qte and panier.referenceObject.stockAlert >=0 and stockManagement %}
<script>
updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', {{ panier.referenceObject.getRefQuantity }} )
</script>
<input type="number" min="1" max="{{ panier.referenceObject.getRefQuantity }}"
name="qte"
id="qte_prod_p_{{ panier.referenceObject.getId() }}"
value="{{ panier.referenceObject.getRefQuantity }}"
onchange="if($('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() <= {{ panier.referenceObject.getRefQuantity }}){updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', $('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() )};"/>
{% else %}
<input type="number" min="1" max="{{ panier.referenceObject.getRefQuantity }}"
name="qte"
id="qte_prod_p_{{ panier.referenceObject.getId() }}" value="{{ panier.qte }}"
{% if panier.referenceObject.stockAlert >=0 and stockManagement %}
onchange="if($('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() <= {{ panier.referenceObject.getRefQuantity }}){updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', $('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() )};"
{% endif %}
/>
{% endif %}
</form>
{% if panier.referenceObject.typeOdyssee != 'soin' and panier.referenceObject.typeOdyssee != 'bkdovalue' and (panier.referenceObject.getRefQuantity is null or panier.referenceObject.getRefQuantity > panier.qte or (panier.referenceObject.stockAlert < 0 and not stockManagement)) %}
<a class="cmdNbBasket plus"
href="javascript:updateQteBasket({{ panier.referenceObject.getId() }}, 'more', '{{ fromPage }}', 1);">
{% if panier.referenceObject.typeOdyssee != 'soin' and panier.referenceObject.typeOdyssee != 'bkdovalue' and (panier.referenceObject.getRefQuantity is null or panier.referenceObject.getRefQuantity > panier.qte or (panier.referenceObject.stockAlert < 0 and not stockManagement)) %}
+
{% endif %}
</a>
{% endif %}
</div>
<div class="d-flex text-end justify-content-end align-items-center p-0">
<a class="retirer"
href="javascript:removeProductBasket({{ panier.referenceObject.getId() }}, '{{ fromPage }}');">
<i class="fa-solid fa-circle-xmark"></i>
</a>
</div>
</div>
{% if panier.referenceObject.getRefQuantity == panier.qte %}
<span class="text-danger">Nombre max d'articles atteint</span>
{% endif %}
</div>
</div>
</div>
</div>
{% else %}
<div id="articlePanier-{{ panier.productObject.idExterne }}"
class="d-flex justify-content-center flex-nowrap">
{# <figure class=""> #}
{# {% set mediaTmp = null %} #}
{# {% set mediaDefault = "default.jpg" %} #}
{# {% set mediaTmp = webp(webpSupported, mediaTmp) %} #}
{# {% set mediaDefault = webp(webpSupported, mediaDefault) %} #}
{# <img class="imgZoom" #}
{# src="{{ asset('/medias_front/products/' ~ mediaTmp|default(mediaDefault)) | imagine_filter('front_basket') }}" #}
{# alt="{{ panier.productObject.Nom }}"> #}
{# </figure> #}
<div class="txtProd d-flex align-items-center flex-wrap">
<div class="d-flex w-100">
<a class="nomProd"
href='{{ panier.productObject.Url }}'>
{{ panier.productObject.Nom }}
</a>
<div class="">
<span class="prixProd rightPanel">
{{ panier.productObject.arrhes|number_format(2, '.', ',') }} €
</span>
</div>
</div>
<span class="qte">Quantité : 1</span>
<div id="gestion-qte-{{ panier.referenceObject }}" class="flexLeft flexMiddle flexNoWrap">
<div class="flexColumn">
<div class="m-0">
<div class="d-flex justify-content-start">
{% set fromPage = fromBasket|default('') %}
{% if app.request.attributes.get('_route') == 'basket_index' %}
{% set fromPage = "panier" %}
{% elseif app.request.attributes.get('_route') == 'basket_delivery' %}
{% set fromPage = "delivery" %}
{% elseif app.request.attributes.get('_route') == 'basket_payment' %}
{% set fromPage = "payment" %}
{% endif %}
</div>
<div class="d-flex text-end justify-content-end align-items-center p-0">
<a class="retrait "
href="javascript:removeProductBasket('{{ panier.referenceObject }}', '{{ fromPage }}');"><i
class="fa-solid fa-circle-xmark"></i></a>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}
{% else %}
<p class="aucun">Aucun article dans votre panier</p>
{% endfor %}
{# <div class="sousTot totallySpies d-flex justify-content-end"> #}
{# <span class="label">SOUS-TOTAL</span> #}
{# <span class="prixPanier">{{ subtotal|number_format(2, '.', ',') }} €</span> #}
{# </div> #}
{# <div class="sousTot flexMiddle flexRight flexNoWrap"> #}
{# <span class="label"> #}
{# FRAIS DE PORT<br> #}
{# <p>(Frais de port pour la France métropolitaine)</p> #}
{# </span> #}
{# <span class="prixPanier">{{ defaultShippingFees|number_format(2, '.', ',') }} €</span> #}
{# </div> #}
<div class="sousTot d-flex justify-content-end ">
<span class="label">TOTAL</span>
{# <span class="prixPanier">{{ (subtotal+defaultShippingFees)|number_format(2, '.', ',') }} €</span> #}
<span class="prixPanier">{{ (subtotal)|number_format(2, '.', ',') }} €</span>
</div>
<div class="d-flex justify-content-center mt-4">
{# <a class="bouton sobre" href='{{ path('front_basket_index') }}'>Passer commande</a> #}
{# <a class="boutonPanier" href='{{ path('front_basket_index') }}'>Voir le panier</a> #}
<a class="boutonCommande" href='{{ path('front_basket_index') }}'>Passer commande</a>
{# {% if app.session.get('customer') is not empty %}
<a class="bouton sobre" href='{{ path('front_customer_deconnection') }}'>Me déconnecter</a>
{% endif %} #}
</div>