{% if products|length > 0 %}
    <div {{ attributes.defaults({ class: 'theme-shop-product-grid' }) }}>
        {% for product in products %}
            {% set reviewSummary = this.getReviewSummary(product) %}
            <div id="{{ product.slug }}" class="theme-shop-product-panel">
                {{ component('cart:ItemForm', {
                    product: product,
                    reviewRatingValue: reviewSummary ? reviewSummary.ratingValue : null,
                    reviewCount: reviewSummary ? reviewSummary.reviewCount : 0,
                    reviewsEnabled: this.reviewsEnabled
                }) }}
            </div>
        {% endfor %}
    </div>
{% else %}
    <div {{ attributes.defaults({ class: 'theme-shop-empty' }) }}>
        {% if category and category.noGroupMatchMessage|default('')|striptags|trim is not empty %}
            <div class="theme-shop-empty__message">
                {{ category.noGroupMatchMessage|raw }}
            </div>
        {% endif %}

        {% if showLoginWhenEmpty %}
            <a href="{{ path('app_login', { _target_path: app.request.requestUri }) }}"
               target="_top"
               class="theme-button-stroke theme-hover-link-effect">
                {{ 'shop.group_code_login'|trans }}
            </a>
        {% endif %}
    </div>
{% endif %}
