templates/Body-panier.html.twig line 1

Open in your IDE?
  1. {% block body %}
  2.     {{ include('partials/_flash_messages.html.twig') }}
  3.     <main class="page-content">
  4.         <!-- Breadcrumb Section Begin -->
  5.         {% include 'partials/_breadcrumb.html.twig' with {
  6.             breadcrumb_image: asset('uploads/brochures/AA_pannier.png'),
  7.             breadcrumb_title: 'Panier',
  8.             breadcrumb_home_path: path('Bussness'),
  9.             breadcrumb_current: 'Panier',
  10.             breadcrumb_heading_level: 'h1'
  11.         } %}
  12.         <!-- Breadcrumb Section End -->
  13.         <!-- Cart Section Begin -->
  14.         <section class="hero cart-page py-5 bg-light">
  15.             <div class="contact spad pt-0">
  16.                 <div class="container">
  17.                     <div class="row justify-content-center">
  18.                         <div class="col-lg-11">
  19.                             <div class="card shadow-lg border-0 rounded-3 cart-card">
  20.                                 <div class="card-header bg-white border-0 d-flex flex-wrap justify-content-between align-items-center">
  21.                                     <div>
  22.                                         <h2 class="card-title h3 mb-1">
  23.                                             <b>Votre Panier</b>
  24.                                         </h2>
  25.                                         {% if Nombre_items > 0 %}
  26.                                             <p class="text-muted mb-0 small">
  27.                                                 {{ Nombre_items }} article{% if Nombre_items > 1 %}s{% endif %} dans votre panier
  28.                                             </p>
  29.                                         {% else %}
  30.                                             <p class="text-muted mb-0 small">
  31.                                                 Aucun article pour le moment.
  32.                                             </p>
  33.                                         {% endif %}
  34.                                 </div>
  35.                                 {% if Nombre_items > 0 %}
  36.                                     <div class="mt-3 mt-md-0">
  37.                                         <a href="{{ path('Bussness')}}" class="btn btn-outline-secondary btn-sm">
  38.                                             <i class="bi bi-arrow-left"></i> Continuer mes achats
  39.                                         </a>
  40.                                     </div>
  41.                                 {% endif %}
  42.                             </div>
  43.                             <div class="card-body p-0">
  44.                                 <div class="table-responsive">
  45.                                     {% if Nombre_items > 0 %}
  46.                                         {% if items is not empty %}
  47.                                         <table class="table table-hover mb-0 align-middle cart-table">
  48.                                             <thead class="thead-light">
  49.                                                 <tr>
  50.                                                     <th class="border-0 px-4 py-3 text-uppercase small text-muted">Produit</th>
  51.                                                     <th class="border-0 py-3 text-end text-uppercase small text-muted">Prix</th>
  52.                                                     <th class="border-0 py-3 text-center text-uppercase small text-muted">Quantité</th>
  53.                                                     <th class="border-0 py-3 text-end text-uppercase small text-muted">Total</th>
  54.                                                     <th class="border-0 py-3 text-center small text-muted">Actions</th>
  55.                                                 </tr>
  56.                                             </thead>
  57.                                             <tbody>
  58.                                                 {% for item in items %}
  59.                                                     <tr>
  60.                                                         <td class="px-4">
  61.                                                             <div class="fw-semibold">{{ item.product.LIBELLE|raw }}</div>
  62.                                                         </td>
  63.                                                         <td class="text-end fw-semibold">
  64.                                                             {% if item.product.hasPromotion() %}
  65.                                                                 <div class="cart-price">
  66.                                                                     <span class="cart-price__current">{{ item.product.prixActuel|number_format(0, ',', ' ') }}</span>
  67.                                                                     <span class="cart-price__old">{{ item.product.PRIX|number_format(0, ',', ' ') }}</span>
  68.                                                                 </div>
  69.                                                             {% else %}
  70.                                                                 {{ item.product.prixActuel|number_format(0, ',', ' ') }}
  71.                                                             {% endif %}
  72.                                                             <span class="text-muted small">fcfa</span>
  73.                                                         </td>
  74.                                                         <td class="text-center">
  75.                                                             <span class="badge bg-light text-dark px-3 py-2 rounded-pill">
  76.                                                                 {{ item.quantity|number_format }}
  77.                                                             </span>
  78.                                                         </td>
  79.                                                         <td class="text-end fw-semibold">
  80.                                                             {{ (item.product.prixActuel * item.quantity)|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span>
  81.                                                         </td>
  82.                                                         <td class="text-center">
  83.                                                             <div class="btn-group btn-group-sm" role="group">
  84.                                                                 <a class="btn btn-outline-success" href="{{ path('TrPanier_add',{'id':item.product.id})}}" title="Ajouter 1">
  85.                                                                     <i class="bi bi-plus-lg"></i>
  86.                                                                 </a>
  87.                                                                 <a class="btn btn-outline-warning" href="{{ path('TrPanier_subtraction',{'id':item.product.id})}}" title="Retirer 1">
  88.                                                                     <i class="bi bi-dash-lg"></i>
  89.                                                                 </a>
  90.                                                                 <a class="btn btn-outline-danger" href="{{ path('panier_remove',{'id':item.product.id})}}" title="Supprimer l'article">
  91.                                                                     <i class="bi bi-trash3"></i>
  92.                                                                 </a>
  93.                                                             </div>
  94.                                                         </td>
  95.                                                     </tr>
  96.                                                 {% endfor %}
  97.                                             </tbody>
  98.                                             <tfoot>
  99.                                                 <tr class="bg-light">
  100.                                                     <td colspan="2" class="border-0"></td>
  101.                                                     <td class="border-0 text-end pe-3">
  102.                                                         <h5 class="mb-0"><b>Total :</b></h5>
  103.                                                     </td>
  104.                                                     <td class="border-0 text-end">
  105.                                                         <h4 class="mb-0 text-success fw-bold">
  106.                                                             {{ productTotal|number_format }} fcfa
  107.                                                         </h4>
  108.                                                     </td>
  109.                                                     <td class="border-0 text-center">
  110.                                                         {% if app.user %}
  111.                                                             <a class="btn btn-primary btn-sm px-4 rounded-pill" href="{{ path('commande')}}">
  112.                                                                 <i class="bi bi-bag-check me-1"></i> Commander les articles
  113.                                                             </a>
  114.                                                         {% else %}
  115.                                                             <button
  116.                                                                 class="btn btn-primary btn-sm px-4 rounded-pill"
  117.                                                                 type="button"
  118.                                                                 id="btn-commander-invite">
  119.                                                                 <i class="bi bi-bag-check me-1"></i> Commander les articles
  120.                                                             </button>
  121.                                                         {% endif %}
  122.                                                     </td>
  123.                                                 </tr>
  124.                                             </tfoot>
  125.                                         </table>
  126.                                         {% endif %}
  127.                                         {% if items is empty and kitItems is defined and kitItems is not empty %}
  128.                                             <div class="p-4 border-top bg-white">
  129.                                                 <div class="alert alert-info mb-0">
  130.                                                     Votre panier contient uniquement des kits promotionnels. Utilisez le formulaire ci-dessous pour confirmer votre interet et etre recontacte.
  131.                                                 </div>
  132.                                             </div>
  133.                                         {% endif %}
  134.                                         {% if kitItems is defined and kitItems is not empty %}
  135.                                             <div class="p-4 border-top bg-white">
  136.                                                 <h5 class="mb-3">Kits promotionnels</h5>
  137.                                                 <table class="table table-hover mb-0 align-middle cart-table">
  138.                                                     <thead class="thead-light">
  139.                                                         <tr>
  140.                                                             <th class="border-0 px-4 py-3 text-uppercase small text-muted">Kit</th>
  141.                                                             <th class="border-0 py-3 text-end text-uppercase small text-muted">Prix</th>
  142.                                                             <th class="border-0 py-3 text-center text-uppercase small text-muted">Quantité</th>
  143.                                                             <th class="border-0 py-3 text-end text-uppercase small text-muted">Total</th>
  144.                                                             <th class="border-0 py-3 text-center small text-muted">Actions</th>
  145.                                                         </tr>
  146.                                                     </thead>
  147.                                                     <tbody>
  148.                                                         {% for item in kitItems %}
  149.                                                             <tr>
  150.                                                                 <td class="px-4">
  151.                                                                     <div class="fw-semibold">{{ item.kit.nom }}</div>
  152.                                                                     <div class="small text-muted">
  153.                                                                         {% for kitItem in item.kit.items|slice(0, 3) %}
  154.                                                                             {{ kitItem.quantite }} x {{ kitItem.produit.LIBELLE }}{% if not loop.last %}, {% endif %}
  155.                                                                         {% endfor %}
  156.                                                                     </div>
  157.                                                                 </td>
  158.                                                                 <td class="text-end fw-semibold">
  159.                                                                     {{ item.kit.prixKit|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span>
  160.                                                                 </td>
  161.                                                                 <td class="text-center">
  162.                                                                     <span class="badge bg-light text-dark px-3 py-2 rounded-pill">
  163.                                                                         {{ item.quantity|number_format }}
  164.                                                                     </span>
  165.                                                                 </td>
  166.                                                                 <td class="text-end fw-semibold">
  167.                                                                     {{ (item.kit.prixKit * item.quantity)|number_format(0, ',', ' ') }} <span class="text-muted small">fcfa</span>
  168.                                                                 </td>
  169.                                                                 <td class="text-center">
  170.                                                                     <div class="btn-group btn-group-sm" role="group">
  171.                                                                         <a class="btn btn-outline-success" href="{{ path('TrPanierKit_add', {'id': item.kit.id}) }}" title="Ajouter 1">
  172.                                                                             <i class="bi bi-plus-lg"></i>
  173.                                                                         </a>
  174.                                                                         <a class="btn btn-outline-warning" href="{{ path('TrPanierKit_subtraction', {'id': item.kit.id}) }}" title="Retirer 1">
  175.                                                                             <i class="bi bi-dash-lg"></i>
  176.                                                                         </a>
  177.                                                                         <a class="btn btn-outline-danger" href="{{ path('TrPanierKit_remove', {'id': item.kit.id}) }}" title="Supprimer le kit">
  178.                                                                             <i class="bi bi-trash3"></i>
  179.                                                                         </a>
  180.                                                                     </div>
  181.                                                                 </td>
  182.                                                             </tr>
  183.                                                         {% endfor %}
  184.                                                     </tbody>
  185.                                                 </table>
  186.                                                 <div class="mt-4 p-4 rounded bg-light">
  187.                                                     <h5 class="mb-2">Demander ces kits</h5>
  188.                                                     <p class="text-muted mb-3">Les kits suivent un traitement dédié. Nous vérifions leur disponibilité puis nous vous recontactons.</p>
  189.                                                     <form method="post" action="{{ path('TrPanierKit_interest') }}">
  190.                                                         <div class="row g-3">
  191.                                                             {% if not app.user %}
  192.                                                                 <div class="col-md-6">
  193.                                                                     <label class="form-label">Nom</label>
  194.                                                                     <input type="text" name="contact_name" class="form-control" required>
  195.                                                                 </div>
  196.                                                                 <div class="col-md-6">
  197.                                                                     <label class="form-label">Téléphone</label>
  198.                                                                     <input type="text" name="contact_phone" class="form-control" required>
  199.                                                                 </div>
  200.                                                             {% else %}
  201.                                                                 <div class="col-md-6">
  202.                                                                     <label class="form-label">Nom</label>
  203.                                                                     <input type="text" class="form-control" value="{{ app.user.FulName }}" disabled>
  204.                                                                 </div>
  205.                                                                 <div class="col-md-6">
  206.                                                                     <label class="form-label">Email</label>
  207.                                                                     <input type="text" class="form-control" value="{{ app.user.email }}" disabled>
  208.                                                                 </div>
  209.                                                             {% endif %}
  210.                                                             <div class="col-12">
  211.                                                                 <label class="form-label">Commentaire</label>
  212.                                                                 <textarea name="commentaire" class="form-control" rows="3" placeholder="Précisez votre besoin, votre commune ou votre date souhaitée."></textarea>
  213.                                                             </div>
  214.                                                             <div class="col-12 d-flex justify-content-between align-items-center">
  215.                                                                 <div class="text-muted small">
  216.                                                                     Total kits : {{ kitTotal|number_format(0, ',', ' ') }} fcfa
  217.                                                                 </div>
  218.                                                                 <button type="submit" class="btn btn-success">
  219.                                                                     Demander ces kits
  220.                                                                 </button>
  221.                                                             </div>
  222.                                                         </div>
  223.                                                     </form>
  224.                                                 </div>
  225.                                             </div>
  226.                                         {% endif %}
  227.                                         {% if items is not empty and not app.user %}
  228.                                             <div id="section-checkout-invite" class="d-none border-top p-4 bg-white">
  229.                                                 <h5 class="mb-3">Finaliser ma commande sans compte</h5>
  230.                                                 <div id="places-alert" class="alert alert-warning d-none" role="alert"></div>
  231.                                                 <form method="post" action="{{ path('news_commande') }}" data-guest-checkout="1">
  232.                                                     <input type="hidden" name="_token" value="{{ csrf_token('guest_checkout') }}">
  233.                                                     <div class="row g-3 align-items-end">
  234.                                                         <div class="col-md-6">
  235.                                                             <label for="commune" class="form-label">Adresse / Livraison (Commune)</label>
  236.                                                             <div class="commune-autocomplete">
  237.                                                                 <input
  238.                                                                     id="commune"
  239.                                                                     name="lieu_livraison"
  240.                                                                     type="text"
  241.                                                                     class="form-control"
  242.                                                                     placeholder="Commune ou ville"
  243.                                                                     required
  244.                                                                     autocomplete="off"
  245.                                                                     aria-autocomplete="list"
  246.                                                                     aria-expanded="false"
  247.                                                                     aria-controls="commune-suggestions">
  248.                                                                 <div id="commune-feedback" class="form-text text-muted d-none" aria-live="polite"></div>
  249.                                                                 <div id="commune-suggestions" class="commune-suggestions d-none" role="listbox" aria-label="Suggestions de communes"></div>
  250.                                                                 <input type="hidden" id="commune_lat" name="commune_lat" value="">
  251.                                                                 <input type="hidden" id="commune_lng" name="commune_lng" value="">
  252.                                                                 <input type="hidden" id="commune_state" name="commune_state" value="">
  253.                                                                 <input type="hidden" id="commune_country" name="commune_country" value="">
  254.                                                                 <input type="hidden" id="commune_countrycode" name="commune_countrycode" value="">
  255.                                                             </div>
  256.                                                         </div>
  257.                                                         <div class="col-md-4">
  258.                                                             <label for="guest_phone" class="form-label">Téléphone</label>
  259.                                                             <input
  260.                                                                 id="guest_phone"
  261.                                                                 name="telephone"
  262.                                                                 type="text"
  263.                                                                 class="form-control"
  264.                                                                 placeholder="Ex: 0749405907"
  265.                                                                 required>
  266.                                                         </div>
  267.                                                         <div class="col-md-2 d-grid">
  268.                                                             <button type="submit" class="btn btn-success">
  269.                                                                 Commander
  270.                                                             </button>
  271.                                                         </div>
  272.                                                     </div>
  273.                                                 </form>
  274.                                             </div>
  275.                                         {% endif %}
  276.                                     {% else %}
  277.                                         <div class="py-5 text-center">
  278.                                             <div class="empty-cart-icon mb-3">
  279.                                                 <i class="bi bi-cart-x display-4 text-muted"></i>
  280.                                             </div>
  281.                                             <h2 class="h4 mb-2"><b>Surprise, c'est vide !</b></h2>
  282.                                             <p class="text-muted mb-4">
  283.                                                 Ajoutez quelques délicieux produits pour commencer votre commande.
  284.                                             </p>
  285.                                             <a href="{{ path('Bussness')}}" class="btn btn-primary px-4 rounded-pill">
  286.                                                 <i class="bi bi-arrow-left me-1"></i> Découvrir les produits
  287.                                             </a>
  288.                                         </div>
  289.                                     {% endif %}
  290.                                 </div>
  291.                             </div>
  292.                         </div>
  293.                     </div>
  294.                 </div>
  295.             </div>
  296.         </div>
  297.     </section>
  298.     </main>
  299. {% endblock %}