<div class="col-xxl-2 col-xl-3 col-lg-4 col-md-4 col-sm-6 col-12 product-card-column">
<div class="card product-card h-100">
<!-- Product Image -->
<div class="product-image">
<div class="image-content">
<div class="image-wrapper">
<img src="{{ asset('img/logo-rapeto-img.png') }}" class="logo">
<a href="{{ path('app_product_show', {'id': product.id}) }}">
<img
src="{{ asset('uploads/products/' ~ product.picture) }}"
class="product-thumb"
alt="{{ product.title }}"
>
</a>
</div>
</div>
</div>
<!-- Card Body -->
<div class="card-body d-flex flex-column">
<!-- Title -->
<h6 class="product-title">
<a href="{{ path('app_product_show', {'id': product.id}) }}"
class="product-link"
data-click-url="{{ path('app_product_click', {'id': product.id}) }}">
{{ product.title }}
</a>
</h6>
<span class="product-type product-type-sale">{{ product.statetypeLabels|join(' / ') }}</span>
<!-- Description -->
<p class="product-desc">
{{ product.desctription|slice(0,60) }}...
</p>
<!-- Price -->
{# <div class="price-section mt-auto">
{% if is_granted('ROLE_COM') %}
<span class="price">
{{ product.priceProducts[0].priceDealer|number_format(2, '.', ' ') }}
</span>
{% elseif is_granted('ROLE_CUSTOMER') %}
<span class="price">
{{ product.priceProducts[0].priceBulkCustomer|number_format(2, '.', ' ') }}
</span>
{% else %}
<span class="price">
{{ product.priceProducts[0].priceCustomer|number_format(2, '.', ' ') }}
</span>
{% endif %}
<sup>{{ product.fkdevise.title }}</sup>
</div> #}
{% set price = product.priceProducts|first %}
<div class="price-section mt-auto d-none">
{% if price %}
{% if is_granted('ROLE_COM') %}
{% set normalPrice = price.priceCustomer %}
{% set promoPrice = price.promoPriceCustomer %}
{% elseif is_granted('ROLE_CUSTOMER') %}
{# {% set normalPrice = price.priceBulkCustomer %}
{% set promoPrice = price.promoPriceBulkCustomer %} #}
{% set normalPrice = price.priceCustomer %}
{% set promoPrice = price.promoPriceCustomer %}
{% else %}
{% set normalPrice = price.priceCustomer %}
{% set promoPrice = price.promoPriceCustomer %}
{% endif %}
{% if price.isPromotionValid and promoPrice %}
<span class="old-price">
{{ normalPrice|number_format(2, '.', ' ') }}
</span>
<br>
<span class="price text-danger fw-bold">
{{ promoPrice|number_format(2, '.', ' ') }}
</span>
{% else %}
<span class="price">
{{ normalPrice|number_format(2, '.', ' ') }}
</span>
{% endif %}
<sup>{{ product.fkdevise.title }}</sup>
{% endif %}
</div>
<!-- Category -->
<small class="text-muted mt-1">
{{ product.fkcategorie.title }}
</small>
<!-- Action -->
<div class="d-flex justify-content-between align-items-center mt-3">
<a href="{{ path('app_product_show', {'id': product.id}) }}"
class="btn btn-outline-primary btn-sm product-link"
data-click-url="{{ path('app_product_click', {'id': product.id}) }}">
Voir
</a>
<a href="{{ path('app_product_panier', {'product': product.id}) }}"
class="btn btn-warning btn-sm d-none"
title="Ajouter au panier"
aria-label="Ajouter {{ product.title }} au panier">
<i class="bi bi-cart-plus-fill"></i>
</a>
</div>
{% if temoin is defined and product.id == temoin %}
<small class="text-danger mt-2">{{ message }} </small>
{% endif %}
</div>
</div>
</div>