templates/cart/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}Mon panier{% endblock %}
  3. {% block body %}
  4.  <!-- Navbar Start -->
  5.     <div class="container-fluid position-relative p-0">
  6.        <div class="container-fluid bg-primary py-5 bg-header" style="margin-bottom: 90px;">
  7.             <div class="row py-5">
  8.                 <div class="col-12 pt-lg-5 mt-lg-5 text-center">
  9.                     <h1 class="display-4 text-white animated zoomIn">Mon Panier</h1>
  10.                     <a href="{{ path('home') }}" class="h5 text-white">Accueil</a>
  11.                     <i class="far fa-circle text-white px-2"></i>
  12.                     <a href="" class="h5 text-white">Panier</a>
  13.                 </div>
  14.             </div>
  15.         </div>
  16.     </div>
  17.     <!-- Navbar End -->
  18.  <!-- Cart Start -->
  19.  <div class="container-fluid pt-5">
  20.     <div class="row px-xl-5">
  21.         <div class="col-lg-8 table-responsive mb-5">
  22.             <table class="table table-bordered text-center mb-0">
  23.                 <thead class="bg-secondary text-dark">
  24.                     <tr>
  25.                         <th>Articles</th>
  26.                         <th>Prix</th>
  27.                         <th>Quantité</th>
  28.                         <th>Total</th>
  29.                         <th>Remove</th>
  30.                     </tr>
  31.                 </thead>
  32.                 <tbody class="align-middle">
  33.                 {% for item in cart %}
  34.                     <tr>
  35.                         <td class="align-middle"><img height="60px" src="/uploads/{{ item.product.image }}" alt="{{ item.product.name }}">{{item.product.name}}</td>
  36.                         <td class="align-middle">{{(item.product.price / 100)|number_format(2,',','.') }} Fr CFA</td>
  37.                         <td class="align-middle">
  38.                             <div class="input-group quantity mx-auto" style="width: 100px;">
  39.                                 <div class="input-group-btn">
  40.                                     <a title="Enlever 1 article" href="{{ path('decrease_item', {id:item.product.id}) }}">
  41.                                         <button class="btn btn-sm btn-primary btn-minus" >
  42.                                             <i class="fa fa-minus"></i>
  43.                                         </button>
  44.                                     </a>
  45.                                 </div>
  46.                                 <input type="text" class="form-control form-control-sm bg-secondary text-center" value=" {{ item.quantity }} ">
  47.                                 <div class="input-group-btn">
  48.                                     <a title="Ajouter 1 article" href="{{ path('add_to_cart', {id:item.product.id}) }}">    
  49.                                         <button class="btn btn-sm btn-primary btn-plus">
  50.                                             <i class="fa fa-plus"></i>
  51.                                         </button>
  52.                                     </a>
  53.                                     
  54.                                 </div>
  55.                             </div>
  56.                         </td>
  57.                         <td class="align-middle">{{ (item.quantity * (item.product.price / 100))|number_format(2,',','.') }} Fr CFA</td>
  58.                         <td class="align-middle"><button class="btn btn-sm btn-primary"><i class="fa fa-times"></i></button></td>
  59.                         <td class="align-middle">
  60.                             <a title="Supprimer tous les articles de cette ligne" href="{{ path('remove_cart_item', {id: item.product.id}) }}" >
  61.                                 <i class="bi bi-trash"></i>
  62.                             </a>
  63.                         </td>
  64.                     </tr>
  65.                 {% endfor %}
  66.                 </tbody>
  67.             </table>
  68.         </div>
  69.         <div class="col-lg-4">
  70.             <form class="mb-5" action="">
  71.                 <div class="input-group">
  72.                     <div class="input-group-append">
  73.                     {% if totalQuantity > 0 %}
  74.                         <a title="Supprimer tous les articles de cette ligne" href="{{ path('remove_cart') }}" >
  75.                             <button class="btn btn-primary">Réinitialiser le panier</button>
  76.                         </a>
  77.                     {% endif %}
  78.                     </div>
  79.                 </div>
  80.             </form>
  81.             <div class="card border-secondary mb-5">
  82.                 <div class="card-header bg-secondary border-0">
  83.                     <h4 class="font-weight-semi-bold m-0">Sommaire panier</h4>
  84.                 </div>
  85.                 <div class="card-body">
  86.                     <div class="d-flex justify-content-between mb-3 pt-1">
  87.                         <h6 class="font-weight-medium">Total Quantité</h6>
  88.                         <h6 class="font-weight-medium">{{ totalQuantity }}</h6>
  89.                     </div>
  90.                 </div>
  91.                 <div class="card-footer border-secondary bg-transparent">
  92.                     <div class="d-flex justify-content-between mt-2">
  93.                         <h5 class="font-weight-bold">Total</h5>
  94.                         <h5 class="font-weight-bold">{{ (totalPrice / 100)|number_format(2,',','.') }} FCFA</h5>
  95.                     </div>
  96.                     <a class="mb-3 d-block" href="{{ path('product') }}">Continuez mes achats</a>
  97.                     {% if totalQuantity > 0 %}
  98.                         <a href="{{ path('order')}}"title="Valider puis passer au paiement" > 
  99.                             <button class="btn btn-block btn-primary my-3 py-3">Valider ma commande</button>
  100.                         </a>
  101.                     {% else %}
  102.                             Votre panier est vide, remplissez le depuis la page <a href="{{ path('product') }}">produits</a>.
  103.                     {% endif %}
  104.                     
  105.                 </div>
  106.             </div>
  107.         </div>
  108.     </div>
  109. </div>
  110. {% endblock %}