src/Flexy/FrontBundle/Themes/CoWorking/templates/cart/_ajaxCart.html.twig line 1

  1. <div class="row">
  2.     <div class="col-lg-12">
  3.         <div class="p-3 bg-white">
  4.             <h5 class="mb-4">Mon Panier</h5>
  5.             {% set cart_items = app.session.get("cart_items") %}
  6.             {% set cart_items_count = cart_items|length %}
  7.             {% set total_price = 0 %} <!-- Nouvelle ligne ajoutée pour initialiser le total à 0 -->
  8.    
  9.     
  10.                 {% for cart_item in app.session.get("cart_items") %}
  11.                 <div class="d-flex justify-content-between align-items-center border-bottom mb-3">
  12.                     <div class="d-flex align-items-center w-50">
  13.                         <p class="mb-0" style="font-size: 14px;">{{cart_item.name}}</p>
  14.                     </div>
  15.                     <div class="d-flex align-items-center w-50 justify-content-end">
  16.                         <p class="mb-0" style="font-size: 14px;"> <span style="font-weight: 700;">{{cart_item.price}} MAD </span></p>
  17.                         <button class="btn btn-sm btn-danger ms-3 delete-cart-item" data-id="{{cart_item.id}}" data-name="{{cart_item.name}}"  data-price="{{cart_item.price}}">
  18.                             <i class="fa-solid fa-trash"></i>
  19.                         </button>
  20.                     </div>
  21.                 </div>
  22.                 {% set total_price = total_price + cart_item.price %} <!-- Ajouter le prix de l'élément actuel au total -->
  23.             {% endfor %}
  24.             <!-- Déplacer cette partie sous la boucle for -->
  25.             
  26.             <div class="d-flex justify-content-end" style="font-size:14px ;">
  27.                 <p >Nombre de produits : <span style="font-weight: 700;">{{ cart_items_count }}</span> <br>
  28.                   Total Prix : <span style="font-weight: 700;">{{ total_price }} MAD</span></p>
  29.                
  30.             </div>
  31.             <div style="height: 10px;"></div> <!-- Ajouter un espace de 10px entre les deux paragraphes -->
  32.         </div>
  33.     </div>
  34.    {# <div class="col-lg-12">
  35.         <div class="p-3 bg-white" style="float: right;">
  36.                 {% if cart_items_count > 0 %}
  37.             <button class="btn col-lg-12" style="border-radius:0px !important;background-color: #E2B653;
  38.     border-color: #E2B653;color:white;width: 200px;
  39.     font-size: 13px;"  >RÉSERVER</button>
  40.       {% endif %}
  41.         </div>
  42.     </div> #}
  43.    
  44. </div>
  45.    
  46.    <!--  <div class="row">
  47.             <div class="col-lg-12">
  48.                 <div class="p-3 bg-white">
  49.                     <h5 class="mb-4">Mon Panier</h5>
  50.                    {% set cart_items = app.session.get("cart_items") %}
  51.                    {% set cart_items_count = cart_items|length %}
  52.                     
  53.                     
  54.                    {% for cart_item in app.session.get("cart_items") %}
  55.                         <div class="d-flex justify-content-between align-items-center border-bottom mb-3">
  56.                         <div class="d-flex align-items-center">
  57.                            <!-- <img src="https://via.placeholder.com/50" alt="Product" class="me-3">-->
  58.                           <!--  <div>
  59.                                 <p class="mb-0" style="font-size: 14px;">{{cart_item.name}} <!--<br>
  60.                                  Prix : {{cart_item.price}} MAD
  61.                                 </p>-->
  62.                           <!--      <p class="mb-0" style="font-size: 14px;" >Prix : {{cart_item.price}} MAD</p>
  63.                             </div>
  64.                         </div>
  65.                         <div class="d-flex align-items-center">
  66.                             <!--<button class="btn btn-sm btn-secondary">-</button>
  67.                             <span class="mx-2">{{cart_item.quantity}}</span>
  68.                             <button class="btn btn-sm btn-secondary">+</button>-->
  69.                          <!--   <button class="btn btn-sm btn-danger ms-3 delete-cart-item" data-id="{{cart_item.id}}" data-name="{{cart_item.name}}"  data-price="{{cart_item.price}}"><i class="fa-solid fa-trash"></i></button>
  70.                         </div>
  71.                     </div>
  72.                    {% endfor %}
  73.                     
  74.                 </div>
  75.             </div>
  76.             <div class="col-lg-12">
  77.                 <div class="p-3 bg-white">
  78.                     <h5 class="mb-4">Total Réservation</h5>
  79.                     <p style="font-size: 13px;">Nombre des produits : {{ cart_items_count }}</p>
  80.                   
  81.                     <button class="btn btn-primary">Checkout</button>
  82.                 </div>
  83.             </div>
  84.         </div>-->