src/Flexy/FrontBundle/Themes/CoWorking/templates/cart/_ajaxCart.html.twig line 1
<div class="row"><div class="col-lg-12"><div class="p-3 bg-white"><h5 class="mb-4">Mon Panier</h5>{% set cart_items = app.session.get("cart_items") %}{% set cart_items_count = cart_items|length %}{% set total_price = 0 %} <!-- Nouvelle ligne ajoutée pour initialiser le total à 0 -->{% for cart_item in app.session.get("cart_items") %}<div class="d-flex justify-content-between align-items-center border-bottom mb-3"><div class="d-flex align-items-center w-50"><p class="mb-0" style="font-size: 14px;">{{cart_item.name}}</p></div><div class="d-flex align-items-center w-50 justify-content-end"><p class="mb-0" style="font-size: 14px;"> <span style="font-weight: 700;">{{cart_item.price}} MAD </span></p><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></div></div>{% set total_price = total_price + cart_item.price %} <!-- Ajouter le prix de l'élément actuel au total -->{% endfor %}<!-- Déplacer cette partie sous la boucle for --><div class="d-flex justify-content-end" style="font-size:14px ;"><p >Nombre de produits : <span style="font-weight: 700;">{{ cart_items_count }}</span> <br>Total Prix : <span style="font-weight: 700;">{{ total_price }} MAD</span></p></div><div style="height: 10px;"></div> <!-- Ajouter un espace de 10px entre les deux paragraphes --></div></div>{# <div class="col-lg-12"><div class="p-3 bg-white" style="float: right;">{% if cart_items_count > 0 %}<button class="btn col-lg-12" style="border-radius:0px !important;background-color: #E2B653;border-color: #E2B653;color:white;width: 200px;font-size: 13px;" >RÉSERVER</button>{% endif %}</div></div> #}</div><!-- <div class="row"><div class="col-lg-12"><div class="p-3 bg-white"><h5 class="mb-4">Mon Panier</h5>{% set cart_items = app.session.get("cart_items") %}{% set cart_items_count = cart_items|length %}{% for cart_item in app.session.get("cart_items") %}<div class="d-flex justify-content-between align-items-center border-bottom mb-3"><div class="d-flex align-items-center"><!-- <img src="https://via.placeholder.com/50" alt="Product" class="me-3">--><!-- <div><p class="mb-0" style="font-size: 14px;">{{cart_item.name}} <!--<br>Prix : {{cart_item.price}} MAD</p>--><!-- <p class="mb-0" style="font-size: 14px;" >Prix : {{cart_item.price}} MAD</p></div></div><div class="d-flex align-items-center"><!--<button class="btn btn-sm btn-secondary">-</button><span class="mx-2">{{cart_item.quantity}}</span><button class="btn btn-sm btn-secondary">+</button>--><!-- <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></div></div>{% endfor %}</div></div><div class="col-lg-12"><div class="p-3 bg-white"><h5 class="mb-4">Total Réservation</h5><p style="font-size: 13px;">Nombre des produits : {{ cart_items_count }}</p><button class="btn btn-primary">Checkout</button></div></div></div>-->