<div class="row p-5 grid-2-4 border-top-2 products-index-large-icons w-100">
{% for product in products %}
<div class="w-100 d-flex flex-column">
{%- set photo = product.photos|first -%}
{%- if photo is not empty and photo.url is not empty -%}
<img src="{{ asset(photo.url)|imagine_filter('product_thumbnail') }}"
class="product-image img-fluid d-block w-100 box-shadow-2"
alt="{{ product.title }}" data-lity
data-lity-target="{{ asset(photo.url)|imagine_filter('product_small') }}">
{%- else -%}
<img src="{{ asset('/assets/static/no-photo.jpg') }}" class="product-image img-fluid d-block w-100 box-shadow-2"
alt="{{ product.title }}">
{%- endif -%}
<a href="{{ path('mdl_app_product_show', { 'id': product.id }) }}"
rel="canonical"
class="color-black mt-5 mb-1 text-center min-h-48">
<b data-toggle="tooltip" data-html="true"
title="{{ product.alternatives|join(', ') }}">{{ product.title }}
{{ product.manufacturer }}</b>
</a>
{% if product.link %}
<a class="text-capitalize table-rbt-txt color-black mb-3 text-center"
href="{{ product.link }}"
target="_blank"
>{{ product.category ? product.category.translate().name|capitalize : '' }}</a>
{% else %}
<span class="table-rbt-txt mb-3 text-center">{{ product.category ? product.category.translate().name|capitalize : '' }}</span>
{% endif %}
<a class="color-black mb-4 text-center" href="{{ path('mdl_app_product_filter_by_size', {
'innerDiameter': product.innerDiameterMin,
'outerDiameter': product.outerDiameterMin,
'width': product.widthMin,
'precision': 0
}) }}">{{ product.dimensions }}</a>
{% set hasActiveDepot = false %}
{% for depot in product.quantities %}
{% if depot.quantity > 0 %}
{% set hasActiveDepot = true %}
{% endif %}
{% endfor %}
{%- set firstDepot = product.quantities|first -%}
{%- set restDepots = product.quantities[1:] -%}
<div class="large-icon-price d-flex align-items-center mb-1">
{% if is_granted('ROLE_CLIENT') %}
<strong>{{ firstDepot|depot_product_price(app.user, true)|number_format(2) }} {{ currency_code(app.user) }}</strong>
{% else %}
<strong>{{ firstDepot|depot_product_price(app.user)|number_format(2) }} {{ currency_code(app.user) }}</strong>
{% endif %}
{% if is_granted('ROLE_CLIENT') %}
{% set depotProduct = firstDepot %}
{% if depotProduct.price > 0 %}
{% include 'ECommerce/App/Product/form_add_to_cart.html.twig' %}
{% else %}
<a class="btn btn-link float-right ml-2 mr-2"
data-toggle="tooltip"
data-html="true"
{% if app.user and app.user.client %}
title="call: {{ app.user.client.firm.phones|first }}"
href="tel:{{ app.user.client.firm.phones|first }}"
{% endif %}
>
<i class="material-icons">call</i>
</a>
{% endif %}
{% else %}
{% set depotProduct = firstDepot %}
{% include 'ECommerce/App/Product/form_add_to_individual_order.html.twig' %}
{% endif %}
</div>
</div>
{% endfor %}
</div>