{% set translated = product|translate %}
{% set promotion = product.inPromotion %}
{# {% dump(product) %} #}
{% if noColumn is defined %}
<div style="{{ customStyle | default("") }}">
{% else %}
<div class="{{ column ?? "col-lg-3" }} col-md-6 col-sm-6 mb-3">
{% endif %}
<figure class="card card-product-grid mb-0 h-100">
<a href="{{ path("product_detail", {id: product.id, brand: product.brand.name | urlSanitizer, slug: translated.slug}) }}">
<div class="img-wrap position-relative" style="">
<img
src="{{ vich_uploader_asset(translated) | imagine_filter('product_list_thumb') }}"
alt="{{ product.name }}"
class="img-fluid product-image"
>
{% if promotion %}
<div class="product-promotion">
- {{ calculPromotionPercent(product) }}%
</div>
{% endif %}
</div>
</a>
<figcaption class="info-wrap border-top d-flex flex-column justify-content-between" style="height: 50%">
<div>
<p class="title mb-2 fw-bold text-center">{{ translated.name }}</p>
<div class="price-wrap text-center">
{% if promotion %}
<span class="price text-decoration-line-through"
id="normal-price">{{ product.price | number_format(2) }} CHF</span>
<span class="price text-primary ms-3"
id="promotional-price">{{ product.priceWithPromotion | number_format(2) }} CHF</span>
{% else %}
<span class="price text-primary"
id="promotional-price">{{ product.price | number_format(2) }} CHF</span>
{% endif %}
</div>
</div>
<div class="text-center mt-3">
{{ include('elements/pagesElements/products/_product_add_cart_btn.html.twig', {product: product}) }}
</div>
</figcaption>
</figure>
</div>