{% block body %} {{ include('partials/_flash_messages.html.twig') }} <main class="page-content"> <!-- Breadcrumb Section Begin --> {% include 'partials/_breadcrumb.html.twig' with { breadcrumb_image: asset('uploads/brochures/AA_pannier.png'), breadcrumb_title: 'Panier', breadcrumb_home_path: path('Bussness'), breadcrumb_current: 'Panier', breadcrumb_heading_level: 'h1' } %} <!-- Breadcrumb Section End --> <!-- Cart Section Begin --> <section class="hero cart-page py-5 bg-light"> <div class="contact spad pt-0"> <div class="container"> <div class="row justify-content-center"> <div class="col-lg-11"> <div class="card shadow-lg border-0 rounded-3 cart-card"> <div class="card-header bg-white border-0 d-flex flex-wrap justify-content-between align-items-center"> <div> <h2 class="card-title h3 mb-1"> <b>Votre Panier</b> </h2> {% if Nombre_items > 0 %} <p class="text-muted mb-0 small"> {{ Nombre_items }} article{% if Nombre_items > 1 %}s{% endif %} dans votre panier </p> {% else %} <p class="text-muted mb-0 small"> Aucun article pour le moment. </p> {% endif %} </div> {% if Nombre_items > 0 %} <div class="mt-3 mt-md-0"> <a href="{{ path('Bussness')}}" class="btn btn-outline-secondary btn-sm"> <i class="bi bi-arrow-left"></i> Continuer mes achats </a> </div> {% endif %} </div> <div class="card-body p-0"> <div class="table-responsive"> {% if Nombre_items > 0 %} {% if items is not empty %} <table class="table table-hover mb-0 align-middle cart-table"> <thead class="thead-light"> <tr> <th class="border-0 px-4 py-3 text-uppercase small text-muted">Produit</th> <th class="border-0 py-3 text-end text-uppercase small text-muted">Prix</th> <th class="border-0 py-3 text-center text-uppercase small text-muted">Quantité</th> <th class="border-0 py-3 text-end text-uppercase small text-muted">Total</th> <th class="border-0 py-3 text-center small text-muted">Actions</th> </tr> </thead> <tbody> {% for item in items %} <tr> <td class="px-4"> <div class="fw-semibold">{{ item.product.LIBELLE|raw }}</div> </td> <td class="text-end fw-semibold"> {% if item.product.hasPromotion() %} <div class="cart-price"> <span class="cart-price__current">{{ item.product.prixActuel|number_format(0, ',', ' ') }}</span> <span class="cart-price__old">{{ item.product.PRIX|number_format(0, ',', ' ') }}</span> </div> {% else %} {{ item.product.prixActuel|number_format(0, ',', ' ') }} {% endif %} <span class="text-muted small">fcfa</span> </td> <td class="text-center"> <span class="badge bg-light text-dark px-3 py-2 rounded-pill"> {{ item.quantity|number_format }} </span> </td> <td class="text-end fw-semibold"> {{ (item.product.prixActuel * item.quantity)|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span> </td> <td class="text-center"> <div class="btn-group btn-group-sm" role="group"> <a class="btn btn-outline-success" href="{{ path('TrPanier_add',{'id':item.product.id})}}" title="Ajouter 1"> <i class="bi bi-plus-lg"></i> </a> <a class="btn btn-outline-warning" href="{{ path('TrPanier_subtraction',{'id':item.product.id})}}" title="Retirer 1"> <i class="bi bi-dash-lg"></i> </a> <a class="btn btn-outline-danger" href="{{ path('panier_remove',{'id':item.product.id})}}" title="Supprimer l'article"> <i class="bi bi-trash3"></i> </a> </div> </td> </tr> {% endfor %} </tbody> <tfoot> <tr class="bg-light"> <td colspan="2" class="border-0"></td> <td class="border-0 text-end pe-3"> <h5 class="mb-0"><b>Total :</b></h5> </td> <td class="border-0 text-end"> <h4 class="mb-0 text-success fw-bold"> {{ productTotal|number_format }} fcfa </h4> </td> <td class="border-0 text-center"> {% if app.user %} <a class="btn btn-primary btn-sm px-4 rounded-pill" href="{{ path('commande')}}"> <i class="bi bi-bag-check me-1"></i> Commander les articles </a> {% else %} <button class="btn btn-primary btn-sm px-4 rounded-pill" type="button" id="btn-commander-invite"> <i class="bi bi-bag-check me-1"></i> Commander les articles </button> {% endif %} </td> </tr> </tfoot> </table> {% endif %} {% if items is empty and kitItems is defined and kitItems is not empty %} <div class="p-4 border-top bg-white"> <div class="alert alert-info mb-0"> Votre panier contient uniquement des kits promotionnels. Utilisez le formulaire ci-dessous pour confirmer votre interet et etre recontacte. </div> </div> {% endif %} {% if kitItems is defined and kitItems is not empty %} <div class="p-4 border-top bg-white"> <h5 class="mb-3">Kits promotionnels</h5> <table class="table table-hover mb-0 align-middle cart-table"> <thead class="thead-light"> <tr> <th class="border-0 px-4 py-3 text-uppercase small text-muted">Kit</th> <th class="border-0 py-3 text-end text-uppercase small text-muted">Prix</th> <th class="border-0 py-3 text-center text-uppercase small text-muted">Quantité</th> <th class="border-0 py-3 text-end text-uppercase small text-muted">Total</th> <th class="border-0 py-3 text-center small text-muted">Actions</th> </tr> </thead> <tbody> {% for item in kitItems %} <tr> <td class="px-4"> <div class="fw-semibold">{{ item.kit.nom }}</div> <div class="small text-muted"> {% for kitItem in item.kit.items|slice(0, 3) %} {{ kitItem.quantite }} x {{ kitItem.produit.LIBELLE }}{% if not loop.last %}, {% endif %} {% endfor %} </div> </td> <td class="text-end fw-semibold"> {{ item.kit.prixKit|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span> </td> <td class="text-center"> <span class="badge bg-light text-dark px-3 py-2 rounded-pill"> {{ item.quantity|number_format }} </span> </td> <td class="text-end fw-semibold"> {{ (item.kit.prixKit * item.quantity)|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span> </td> <td class="text-center"> <div class="btn-group btn-group-sm" role="group"> <a class="btn btn-outline-success" href="{{ path('TrPanierKit_add', {'id': item.kit.id}) }}" title="Ajouter 1"> <i class="bi bi-plus-lg"></i> </a> <a class="btn btn-outline-warning" href="{{ path('TrPanierKit_subtraction', {'id': item.kit.id}) }}" title="Retirer 1"> <i class="bi bi-dash-lg"></i> </a> <a class="btn btn-outline-danger" href="{{ path('TrPanierKit_remove', {'id': item.kit.id}) }}" title="Supprimer le kit"> <i class="bi bi-trash3"></i> </a> </div> </td> </tr> {% endfor %} </tbody> </table> <div class="mt-4 p-4 rounded bg-light"> <h5 class="mb-2">Demander ces kits</h5> <p class="text-muted mb-3">Les kits suivent un traitement dédié. Nous vérifions leur disponibilité puis nous vous recontactons.</p> <form method="post" action="{{ path('TrPanierKit_interest') }}"> <div class="row g-3"> {% if not app.user %} <div class="col-md-6"> <label class="form-label">Nom</label> <input type="text" name="contact_name" class="form-control" required> </div> <div class="col-md-6"> <label class="form-label">Téléphone</label> <input type="text" name="contact_phone" class="form-control" required> </div> {% else %} <div class="col-md-6"> <label class="form-label">Nom</label> <input type="text" class="form-control" value="{{ app.user.FulName }}" disabled> </div> <div class="col-md-6"> <label class="form-label">Email</label> <input type="text" class="form-control" value="{{ app.user.email }}" disabled> </div> {% endif %} <div class="col-12"> <label class="form-label">Commentaire</label> <textarea name="commentaire" class="form-control" rows="3" placeholder="Précisez votre besoin, votre commune ou votre date souhaitée."></textarea> </div> <div class="col-12 d-flex justify-content-between align-items-center"> <div class="text-muted small"> Total kits : {{ kitTotal|number_format(0, ',', ' ') }} fcfa </div> <button type="submit" class="btn btn-success"> Demander ces kits </button> </div> </div> </form> </div> </div> {% endif %} {% if items is not empty and not app.user %} <div id="section-checkout-invite" class="d-none border-top p-4 bg-white"> <h5 class="mb-3">Finaliser ma commande sans compte</h5> <div id="places-alert" class="alert alert-warning d-none" role="alert"></div> <form method="post" action="{{ path('news_commande') }}" data-guest-checkout="1"> <input type="hidden" name="_token" value="{{ csrf_token('guest_checkout') }}"> <div class="row g-3 align-items-end"> <div class="col-md-6"> <label for="commune" class="form-label">Adresse / Livraison (Commune)</label> <div class="commune-autocomplete"> <input id="commune" name="lieu_livraison" type="text" class="form-control" placeholder="Commune ou ville" required autocomplete="off" aria-autocomplete="list" aria-expanded="false" aria-controls="commune-suggestions"> <div id="commune-feedback" class="form-text text-muted d-none" aria-live="polite"></div> <div id="commune-suggestions" class="commune-suggestions d-none" role="listbox" aria-label="Suggestions de communes"></div> <input type="hidden" id="commune_lat" name="commune_lat" value=""> <input type="hidden" id="commune_lng" name="commune_lng" value=""> <input type="hidden" id="commune_state" name="commune_state" value=""> <input type="hidden" id="commune_country" name="commune_country" value=""> <input type="hidden" id="commune_countrycode" name="commune_countrycode" value=""> </div> </div> <div class="col-md-4"> <label for="guest_phone" class="form-label">Téléphone</label> <input id="guest_phone" name="telephone" type="text" class="form-control" placeholder="Ex: 0749405907" required> </div> <div class="col-md-2 d-grid"> <button type="submit" class="btn btn-success"> Commander </button> </div> </div> </form> </div> {% endif %} {% else %} <div class="py-5 text-center"> <div class="empty-cart-icon mb-3"> <i class="bi bi-cart-x display-4 text-muted"></i> </div> <h2 class="h4 mb-2"><b>Surprise, c'est vide !</b></h2> <p class="text-muted mb-4"> Ajoutez quelques délicieux produits pour commencer votre commande. </p> <a href="{{ path('Bussness')}}" class="btn btn-primary px-4 rounded-pill"> <i class="bi bi-arrow-left me-1"></i> Découvrir les produits </a> </div> {% endif %} </div> </div> </div> </div> </div> </div> </div> </section> </main>{% endblock %}