{% macro card(product) %} {% set title = product.name[language] ~ ' ' ~ product.brand[language] ~ format_dimensions(product.dimensions.x, product.dimensions.y, product.dimensions.z, ' ') ~ ' ' ~ product.weight ~ 'г' %} {{ title | length > 45 ? title | slice(0, 45) ~ '...' : title }} {{ product.cost }}р {% endmacro %} {% if products is not empty %} {% for product in products %} {% if loop.index % 2 == 1 %} {{ _self.card(product) }} {% endif %} {% endfor %} {% for product in products %} {% if loop.index % 2 == 0 %} {{ _self.card(product) }} {% endif %} {% endfor %} {% endif %}
{{ title | length > 45 ? title | slice(0, 45) ~ '...' : title }}