{% extends 'base.html.twig' %}
{% block style %}
{% endblock %}
{% block titre %} Panier {% endblock %}
{% block body %}
<main class="main">
<div class="page-header breadcrumb-wrap">
<div class="container">
<div class="breadcrumb">
<a href="{{ path('app_accueil') }}" rel="nofollow"><i class="fi-rs-home mr-5"></i>Accueil</a>
<span></span> Panier
</div>
</div>
</div>
{% if elements | length > 0 %}
<div class="container mb-80 mt-50">
<div class="row">
<div class="col-lg-8 mb-40">
<h1 class="heading-2 mb-10">Votre panier</h1>
<div class="d-flex justify-content-between">
<h6 class="text-body">Vous avez <span class="text-brand">{{ elements | length }}</span>
produit
dans votre panier</h6>
<h6 class="text-body"><a href="#" class="text-muted"><i class="fi-rs-trash mr-5"></i>Vider
le
panier</a></h6>
</div>
</div>
<div class="col-lg-4 mb-40">
</div>
</div>
<div class="row">
<div class="col-lg-9">
<div class="table-responsive shopping-summery">
<table class="table table-wishlist">
<thead>
<tr class="main-heading">
<th scope="col" colspan="2">Produit</th>
<th scope="col">Prix</th>
<th scope="col">Quantite</th>
<th scope="col">Total</th>
<th scope="col" class="end">Supprimer</th>
</tr>
</thead>
<tbody>
{% for element in elements %}
<tr class="pt-30">
<td class="image product-thumbnail pt-40"><img
src="{{ asset('uploads/images/produits/') }}{{ element.produit.images|first }}" alt="{{ element.produit.nom }}"></td>
<td class="product-des product-name">
<h6 class="mb-5"><a class="product-name mb-10 text-heading"
href="{{ path('app_accueil_show_produit',{slug :element.produit.slug }) }}">{{ element.produit.nom }}
</a></h6>
</td>
<td class="price" data-title="Price">
<h4 class="text-body">{{ element.produit.Prix |number_format(0, ' ', ' ') }} FCFA </h4>
</td>
<td class="text-center detail-info" data-title="Stock">
<div class="detail-extralink mr-15">
<div class="detail-qty border radius">
<a href="{{ path('cart_remove',{id :element.produit.id }) }}" class="qty-down"><i class="fi-rs-angle-small-down"></i></a>
<span class="qty-val">{{ element.quantite }}</span>
<a href="{{ path('cart_add',{id :element.produit.id }) }}" class="qty-up"><i class="fi-rs-angle-small-up"></i></a>
</div>
</div>
</td>
<td class="price" data-title="Price">
<h4 class="text-brand">{{ (element.produit.Prix * element.quantite)|number_format(0, ' ', ' ') }} FCFA</h4>
</td>
<td class="action text-center" data-title="Remove"><a href="#"
class="text-body"><i
class="fi-rs-trash"></i></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="col-lg-3 mb-40">
<div class="table-responsive">
<table class="table no-border">
<tbody>
<tr>
<td scope="col" colspan="2">
<div class="divider-2 mt-10 mb-10"></div>
</td>
</tr>
<tr>
<td class="cart_total_label">
<h6 class="text-muted">Total</h6>
</td>
<td class="cart_total_amount">
<h4 class="text-brand text-end">{{ total |number_format(0, ' ', ' ') }} FCFA</h4>
</td>
</tr>
</tbody>
</table>
</div>
<a href="{{ path('commande_chechkout')}}" class="btn mb-20 w-100">Finalisez la commande<i class="fi-rs-sign-out ml-15"></i></a>
</div>
</div>
</div>
{% else %}
<div class="container mb-80 mt-50">
<div class="row">
<div class="col-lg-8 mb-40">
<h1 class="heading-2 mb-10">Votre panier</h1>
<div class="d-flex justify-content-between">
<h6 class="text-body">Votre panier est vide</h6>
</div>
</div>
<div class="col-lg-4 mb-40">
</div>
</div>
</div>
{% endif %}
<div class="container mb-30">
<div class="row mt-60">
<div class="col-12">
<h2 class="section-title style-1 mb-30">Les visiteurs ont également acheté</h2>
</div>
<div class="col-12">
<div class="row related-products">
{% for prod in produits %}
<div class="col-lg-3 col-md-4 col-12 col-sm-6">
<div class="product-cart-wrap hover-up">
<div class="product-img-action-wrap">
<div class="product-img product-img-zoom">
<a href="{{ path('app_accueil_show_produit',{'slug': prod.slug}) }}" tabindex="0">
<img class="default-img" src="{{ asset('uploads/images/produits/'~ prod.images| first) }}" alt="">
<img class="hover-img" src="{{ asset('uploads/images/produits/'~ prod.images| last) }}" alt="">
</a>
</div>
<div class="product-action-1">
<a aria-label="Quick view" class="action-btn small hover-up"
data-bs-toggle="modal" data-bs-target="#quickViewModal"><i
class="fi-rs-search"></i></a>
</div>
<div class="product-badges product-badges-position product-badges-mrg">
{# <span class="hot">Hot</span>#}
</div>
</div>
<div class="product-content-wrap">
<h2><a href="{{ path('app_accueil_show_produit',{'slug': prod.slug}) }}" tabindex="0">{{ prod.nom }}</a>
</h2>
{# <div class="rating-result" title="90%">#}
{# <span> </span>#}
{# </div>#}
<div class="product-price">
<span>{{ prod.prix }} FCFA </span>
{# <span class="old-price">$245.8</span>#}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</main>
{% endblock %}