{% macro card(product) %} {% set title = product.name ~ ' ' ~ product.brand ~ format_dimensions(product.dimensions.x, product.dimensions.y, product.dimensions.z, ' ') ~ ' ' ~ product.weight ~ 'г' %} {% set amount = cart[product.getId()].amount ?? 0 %}
{{ product.name }}

{{ title | length > 45 ? title | slice(0, 45) ~ '...' : title }}

0 %} style="--hue-rotate-offset: {{ amount }}0deg;"{% endif %}>
{% 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 %}