{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
{% if product.imagesByType('image_product_secondary') is not empty %}
{% set source_path = product.imagesByType('image_product_secondary').first.path %}
{% set path = source_path|imagine_filter('app_product_fabric_small_thumbnail_listing') %}
{% elseif product.images.first %}
{% set source_path = product.images.first.path %}
{% set path = source_path|imagine_filter('app_product_fabric_small_thumbnail_listing') %}
{% else %}
{% set path = asset('webapic-theme/images/icon-gmap.png') %}
{% endif %}
<div class="listing1-product-ctn card tissu">
{% include 'partials/block-add-to-wishlist.html.twig' with {'product': product} %}
<a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" class="">
<div class="img-ctn">
<div class="flag">
{% include 'partials/block-callout.html.twig' with {'callout': product.badge} only %}
</div>
<div class="img-ctn-content">
<img class="lazy" data-src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
</div>
</div>
<div class="title">{{ product.name }}</div>
{% set price = money.calculatePrice(product) %}
{% set originalPrice = money.calculateOriginalPrice(product) %}
{% spaceless %}
<div class="sylius-product-price price" {{ sylius_test_html_attribute('product-price') }}>
{% if product.product.conditioning == 'per_meter_each_0_5_meter' %}
{{ price }}/m
{% elseif product.product.conditioning == 'card_kdo_per_euros_each_10_euros' %}
{{ 'app.front.listing.product.from'|trans }} 10€
{% else %}
{{ price }}
{% endif %}
</div>
{% endspaceless %}
</a>
</div>