<div class="section-products-item">
<div class="section-products-item-img-container banner_thumb">
<a href="{{path('app_product_details', {'slugCatProduct': product.slugCatProduct, 'slugProduct': product.slugProduct, 'id': product.id})}}">
{% if product.image %}
<img class="section-products-item-img lazyload" data-src="{{ asset( files_directory_relative ~ product.image) }}" alt="{{product.legendeimage|default('image ' ~ product.getNameByDefaultLocale ~ 'Tany mena')}}"/>
{% else %}
<img class="section-products-item-img lazyload" data-src="{{ asset('/assets/img/webp/default-image.webp') }}" alt="{{product.legendeimage|default('image ' ~ product.getNameByDefaultLocale ~ 'Tany mena')}}"/>
{% endif %}
</a>
</div>
<div class="p-3">
<p class="text-black section-products-item-title mb-2">{{product.getNameByDefaultLocale}}</span>
<p class="text-primary section-products-item-price">{{product.cost|format_currency('EUR')}}</p>
{% if product.available %}
<form action="{{path('app_cart_add')}}" method="POST">
<input type="hidden" value="1" name="quantity"/>
<input type="hidden" value="{{product.id}}" name="product_id"/>
<button class="btn af-btn-primary-outline w-100 text-center" type="submit">
<i class="fa-solid fa-cart-shopping me-2"></i>
{% if product.preOrder %}
{% trans from 'messages.shop' %}Précommander{% endtrans %}
{% else %}
{% trans from 'messages.shop' %}Ajouter au panier{% endtrans %}
{% endif %}
</button>
</form>
{% else %}
{# <button class="button-no-style" type="button" disabled>Rupture de stock</button> #}
<button class="btn af-btn-primary-outline w-100 text-center" disabled>
{% trans from 'messages.shop' %}Bientôt disponible{% endtrans %}
</button>
{% endif %}
</div>
</div>