templates/layouts/layouts_front/tpl_basket_panel.html.twig line 1

Open in your IDE?
  1. <div id="headBasket" class="flexJustify flexMiddle flexNoWrap">
  2.     <h3 class=" titlePannel">Mon panier</h3>
  3.     <a href="javascript:toggleBasketPanel();" id="closeBasketPanel" class="aTxtHide"></a>
  4. </div>
  5. {% set prodCold = false %}
  6. {% for panier in basket %}
  7.     {% if panier.referenceObject.getId() is defined %}
  8.         <div id="articlePanier-{{ panier.referenceObject.getId() }}"
  9.              class="d-flex justify-content-center flex-nowrap {% if panier.discount_amount_unitary is defined %} discount{% endif %}">
  10.             {#            <figure class="{% if panier.productObject.getProdCold() %} prodCold {% endif %}"> #}
  11.             {#                {% set mediaTmp = panier.productObject.getProdPicture() %} #}
  12.             {#                {% set mediaDefault = "default.jpg" %} #}
  13.             {#                {% set mediaTmp = webp(webpSupported, mediaTmp) %} #}
  14.             {#                {% set mediaDefault = webp(webpSupported, mediaDefault) %} #}
  15.             {#                <img class="imgZoom" #}
  16.             {#                     src="{{ asset('/medias_front/products/' ~  mediaTmp|default(mediaDefault)) | imagine_filter('front_basket') }}" #}
  17.             {#                     alt="{{ panier.productObject.getProdModel() }}"> #}
  18.             {#            </figure> #}
  19.             <div class="txtProd">
  20.                 <div class="row">
  21.                     <a class="nomProd"
  22.                        href='{{ path('front_shopping_fiche', {product_name:panier.productObject.getProdModel()|urlrewrite, prod_id:panier.productObject.getId() }) }}'>
  23.                         {{ panier.productObject.getProdModel() }}
  24.                         {% if panier.productObject.getProdType() == 'multiple' %}
  25.                             ,{{ panier.referenceObject.getRefEntitled() }}
  26.                         {% endif %}
  27.                     </a>
  28.                     <div class="">
  29.                         {% if panier.discount_amount_unitary is defined %}
  30.                             <span class="prixProd"><!--prix unitaire :-->{{ panier.discount_amount_unitary|number_format(2, '.', ',') }}&nbsp;€</span>
  31.                         {% else %}
  32.                             {% if panier.referenceObject.getRefSellingPrice() > panier.referenceObject.getRefReferencePrice() %}
  33.                                 <span class="prixProd bare rightPanel"><!--prix baré :-->{{ panier.referenceObject.getRefSellingPrice()|number_format(2, '.', ',') }}&nbsp;€</span>
  34.                             {% endif %}
  35.                             <span class="prixProd rightPanel"><!--prix unitaire :-->{{ panier.referenceObject.getRefReferencePrice()|number_format(2, '.', ',') }}&nbsp;€</span>
  36.                         {% endif %}
  37.                     </div>
  38.                 </div>
  39.                 <div id="gestion-qte-{{ panier.referenceObject.getId() }}" class="flexLeft flexMiddle flexNoWrap">
  40.                     <div class="flexColumn">
  41.                         <div class="m-0 row d-flex align-items-center ">
  42.                             <span class="qte col-2">Qté :</span>
  43.                             <div class="col-3 d-flex justify-content-start qteBasket">
  44.                                 {% set fromPage = fromBasket|default('') %}
  45.                                 {% if app.request.attributes.get('_route') == 'basket_index' %}
  46.                                     {% set fromPage = "panier" %}
  47.                                 {% elseif app.request.attributes.get('_route') == 'basket_delivery' %}
  48.                                     {% set fromPage = "delivery" %}
  49.                                 {% elseif app.request.attributes.get('_route') == 'basket_payment' %}
  50.                                     {% set fromPage = "payment" %}
  51.                                 {% endif %}
  52.                                 
  53.                                 {% 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)) %}
  54.                                     <a class="cmdNbBasket moins" {% if panier.qte != 1 %} href="javascript:updateQteBasket({{ panier.referenceObject.getId() }}, 'less', '{{ fromPage }}' );"{% endif %}>{% if panier.qte > 1 %}-{% endif %}</a>
  55.                                 {% endif %}
  56.                                 <form id="formQte{{ panier.referenceObject.getId() }}" method="post" action="">
  57.                                     {% if panier.referenceObject.getRefQuantity < panier.qte and panier.referenceObject.stockAlert >=0 and stockManagement %}
  58.                                         <script>
  59.                                             updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', {{ panier.referenceObject.getRefQuantity }} )
  60.                                         </script>
  61.                                         <input type="number" min="1" max="{{ panier.referenceObject.getRefQuantity }}"
  62.                                                name="qte"
  63.                                                id="qte_prod_p_{{ panier.referenceObject.getId() }}"
  64.                                                value="{{ panier.referenceObject.getRefQuantity }}"
  65.                                                onchange="if($('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() <= {{ panier.referenceObject.getRefQuantity }}){updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', $('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() )};"/>
  66.                                     {% else %}
  67.                                     <input type="number" min="1" max="{{ panier.referenceObject.getRefQuantity }}"
  68.                                            name="qte"
  69.                                            id="qte_prod_p_{{ panier.referenceObject.getId() }}" value="{{ panier.qte }}"
  70.                                             {% if panier.referenceObject.stockAlert >=0 and stockManagement %}
  71.                                                 onchange="if($('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() <= {{ panier.referenceObject.getRefQuantity }}){updateQteBasket({{ panier.referenceObject.getId() }}, '', '{{ fromPage }}', $('#qte_prod_p_{{ panier.referenceObject.getId() }}').val() )};"
  72.                                             {% endif %}
  73.                                     />
  74.                                     {% endif %}
  75.                                 </form>
  76.                                 {% 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)) %}
  77.                                     <a class="cmdNbBasket plus"
  78.                                        href="javascript:updateQteBasket({{ panier.referenceObject.getId() }}, 'more', '{{ fromPage }}', 1);">
  79.                                         {% 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)) %}
  80.                                             +
  81.                                         {% endif %}
  82.                                     </a>
  83.                                 {% endif %}
  84.                             </div>
  85.                             <div class="d-flex text-end justify-content-end align-items-center p-0">
  86.                                 <a class="retirer"
  87.                                    href="javascript:removeProductBasket({{ panier.referenceObject.getId() }}, '{{ fromPage }}');">
  88.                                     <i class="fa-solid fa-circle-xmark"></i>
  89.                                 </a>
  90.                             </div>
  91.                         </div>
  92.                         {% if panier.referenceObject.getRefQuantity == panier.qte %}
  93.                             <span class="text-danger">Nombre max d'articles atteint</span>
  94.                         {% endif %}
  95.                     </div>
  96.                 </div>
  97.             </div>
  98.         </div>
  99.     {% else %}
  100.         <div id="articlePanier-{{ panier.productObject.idExterne }}"
  101.              class="d-flex justify-content-center flex-nowrap">
  102.             {#            <figure class=""> #}
  103.             {#                {% set mediaTmp = null %} #}
  104.             {#                {% set mediaDefault = "default.jpg" %} #}
  105.             {#                {% set mediaTmp = webp(webpSupported, mediaTmp) %} #}
  106.             {#                {% set mediaDefault = webp(webpSupported, mediaDefault) %} #}
  107.             {#                <img class="imgZoom" #}
  108.             {#                     src="{{ asset('/medias_front/products/' ~  mediaTmp|default(mediaDefault)) | imagine_filter('front_basket') }}" #}
  109.             {#                     alt="{{ panier.productObject.Nom }}"> #}
  110.             {#            </figure> #}
  111.             <div class="txtProd d-flex align-items-center flex-wrap">
  112.                 <div class="d-flex w-100">
  113.                     <a class="nomProd"
  114.                        href='{{ panier.productObject.Url }}'>
  115.                         {{ panier.productObject.Nom }}
  116.                     </a>
  117.                     <div class="">
  118.                         <span class="prixProd rightPanel">
  119.                             {{ panier.productObject.arrhes|number_format(2, '.', ',') }}&nbsp;€
  120.                         </span>
  121.                     </div>
  122.                 </div>
  123.                 <span class="qte">Quantité : 1</span>
  124.                 <div id="gestion-qte-{{ panier.referenceObject }}" class="flexLeft flexMiddle flexNoWrap">
  125.                     <div class="flexColumn">
  126.                         <div class="m-0">
  127.                             <div class="d-flex justify-content-start">
  128.                                 {% set fromPage = fromBasket|default('') %}
  129.                                 {% if app.request.attributes.get('_route') == 'basket_index' %}
  130.                                     {% set fromPage = "panier" %}
  131.                                 {% elseif app.request.attributes.get('_route') == 'basket_delivery' %}
  132.                                     {% set fromPage = "delivery" %}
  133.                                 {% elseif app.request.attributes.get('_route') == 'basket_payment' %}
  134.                                     {% set fromPage = "payment" %}
  135.                                 {% endif %}
  136.                             </div>
  137.                             <div class="d-flex text-end justify-content-end align-items-center p-0">
  138.                                 <a class="retrait "
  139.                                    href="javascript:removeProductBasket('{{ panier.referenceObject }}', '{{ fromPage }}');"><i
  140.                                             class="fa-solid fa-circle-xmark"></i></a>
  141.                             </div>
  142.                         </div>
  143.                     </div>
  144.                 </div>
  145.             </div>
  146.         </div>
  147.     {% endif %}
  148. {% else %}
  149.     <p class="aucun">Aucun article dans votre panier</p>
  150. {% endfor %}
  151. {# <div class="sousTot totallySpies d-flex justify-content-end"> #}
  152. {#    <span class="label">SOUS-TOTAL</span> #}
  153. {#    <span class="prixPanier">{{ subtotal|number_format(2, '.', ',') }}&nbsp;€</span> #}
  154. {# </div> #}
  155. {# <div class="sousTot flexMiddle flexRight flexNoWrap"> #}
  156. {#    <span class="label"> #}
  157. {#        FRAIS DE PORT<br> #}
  158. {#        <p>(Frais de port pour la France métropolitaine)</p> #}
  159. {#    </span> #}
  160. {#    <span class="prixPanier">{{ defaultShippingFees|number_format(2, '.', ',') }}&nbsp;€</span> #}
  161. {# </div> #}
  162. <div class="sousTot  d-flex justify-content-end ">
  163.     <span class="label">TOTAL</span>
  164.     {#    <span class="prixPanier">{{ (subtotal+defaultShippingFees)|number_format(2, '.', ',') }}&nbsp;€</span> #}
  165.     <span class="prixPanier">{{ (subtotal)|number_format(2, '.', ',') }}&nbsp;€</span>
  166. </div>
  167. <div class="d-flex justify-content-center mt-4">
  168.     {#    <a class="bouton sobre" href='{{ path('front_basket_index') }}'>Passer commande</a> #}
  169.     {#    <a class="boutonPanier" href='{{ path('front_basket_index') }}'>Voir le panier</a> #}
  170.     <a class="boutonCommande" href='{{ path('front_basket_index') }}'>Passer commande</a>
  171.     {#  {% if app.session.get('customer') is not empty %}
  172.         <a class="bouton sobre" href='{{ path('front_customer_deconnection') }}'>Me déconnecter</a>
  173.     {% endif %} #}
  174. </div>