{% set productVariant = get_lowest_availability_variant(product.productVariants) %}
{% set digitalVersion = get_digital_version(product.productVariants) %}
<a href="{{ path('shop_product', {slug:product.slug}) }}" class="shop-publication">
<div class="shop-publication__cover">
{% if productVariant.productVariantUploadGroups|length > 0 and productVariant.productVariantUploadGroups[0].UploadGroup.upload|length > 0 %}
<img alt="Foto produktu" src="{{ asset(productVariant.productVariantUploadGroups[0].UploadGroup.upload[0].path) }}" class="shop-publication__image">
{% else %}
<img class="shop-publication__image" src="{{ asset('build/img/mua-no-photo.jpg') }}" alt="Foto produktu">
{% endif %}
<div class="badges">
{% if digitalVersion %}
<div class="badge">
<svg width="26" height="26"><use href="{{ asset('/build/svg/_btn-icons.svg#digital') }}"></svg>
</div>
{% endif %}
{% if productVariant.price and productVariant.availability.id in [1, 2] %}
<div class="badge">
<img alt="cart" src="{{ asset('/build/svg/cart.svg') }}">
</div>
{% endif %}
</div>
</div>
<div class="shop-publication__info">
<div class="shop-publication__title h4">{{ product.name }}</div>
{% if productVariant.name != product.name %}
<div class="shop-publication__author">{{ productVariant.name }}</div>
{% endif %}
<p class="shop-publication__author">{{ get_product_author(productVariant) }}</p>
</div>
</a>