{% import '@SyliusUi/Macro/messages.html.twig' as messages %}
{% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}

{{ sylius_template_event('sylius.shop.product.index.search', _context) }}

{{ sylius_template_event('sylius.shop.product.index.before_list', {'products': resources.data}) }}

{% if resources.data|length > 0 %}
    <div class="product-list row" id="products" {{ sylius_test_html_attribute('products') }}>
        {% for product in resources.data %}
            <div class="col-6 col-md-4 d-flex">
                {% include '@SyliusShop/Product/_box.html.twig' %}
            </div>
        {% endfor %}
    </div>

    {{ sylius_template_event('sylius.shop.product.index.before_pagination', {'products': resources.data}) }}

    {{ pagination.simple(resources.data) }}
{% else %}
    {{ messages.info('sylius.ui.no_results_to_display') }}
{% endif %}
