{% import "@SyliusShop/Common/Macro/money.html.twig" as money %}
<div class="association-ctn-product">
{% if product.imagesByType('image_product_main') is not empty %}
{% set source_path = product.imagesByType('image_product_main').first.path %}
{% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
{% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
{% elseif product.images.first %}
{% set source_path = product.images.first.path %}
{% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
{% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
{% else %}
{% set original_path = asset('webapic-theme/images/icon-gmap.png') %}
{% set path = original_path %}
{% endif %}
<a href="{{ path('app_product_variant_show', {'slug': product.slug, 'id': product.id}) }}" class="ui fluid image">
<div class="img-ctn">
<div class="img-ctn-content">
<img src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
{% set path = '' %}
{% if product.imagesByType('image_product_hover') is not empty %}
{% set source_path = product.imagesByType('image_product_hover').first.path %}
{% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
{% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
{% elseif product.images.first %}
{% set source_path = product.images.first.path %}
{% set original_path = source_path|imagine_filter('sylius_shop_product_original') %}
{% set path = source_path|imagine_filter(filter|default('app_product_small_thumbnail_listing')) %}
{% endif %}
{% if path is not empty %}
<img class="hover" src="{{ path }}" id="main-image" alt="{{ product.name }}" {{ sylius_test_html_attribute('main-image') }} />
{% endif %}
<div class="add">
<button
{# href="{{ path('bitbag_sylius_wishlist_plugin_shop_wishlist_add_product', {'productId': product.id}) }}" #}
class="bitbag-add-to-wishlist"
data-product-name="{{ product.name }}"
{{ sylius_test_html_attribute('wishlist-add-product') }}
>
<i class="heart outline icon"></i>
{# {{ 'bitbag_sylius_wishlist_plugin.ui.add_to_wishlist'|trans }} #}
</button>
<button class="js-add-to-cart" data-url="{{ path('app_cart_add_to_cart_ajax') }}" data-postdata="{{ '{"' ~ product.id ~ '":1}' }}">
<img src="{{ asset('webapic-theme/images/icon-panier.svg') }}" class="ui image" />
</button>
</div>
</div>
</div>
</a>
</div>