templates/shop/product/_product_preview.html.twig line 1

  1. {% 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 %}
                {% if 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 alt="Foto produktu" class="shop-publication__image" src="{{ asset('/build/img/mua-no-photo.jpg') }}">
                {% endif %}
            {% else %}
                <img alt="Foto produktu" class="shop-publication__image" src="{{ asset('/build/img/mua-no-photo.jpg') }}">
            {% 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">
            <h4 class="shop-publication__title">{{ product.name }}</h4>
            {% if productVariant.name != product.name %}
                <p class="shop-publication__author">{{ productVariant.name }}</p>
            {% endif %}
            <p class="shop-publication__author">{{get_product_author(productVariant)}}</p>
        </div>
    </a>