custom/plugins/IabTheme/src/Resources/views/storefront/component/product/teaser-properties.html.twig line 1

Open in your IDE?
  1. {% block component_product_teaser_properties %}
  2.     <div class="product-teaser-properties row mx-n2">
  3.         {% for element in group.elements %}
  4.             {% if element.translated.customFields.custom_property_groups_teaser_prod_prop %}
  5.                 {% set activeOptions = element.options.elements|filter(o => o.group) %}
  6.                 {% set firstColor = (activeOptions|first).colorHexCode|default('#c4e76a') %}
  7.                 {% set lastColor = (activeOptions|last).colorHexCode|default('#0d553f') %}
  8.                 {% set border = (activeOptions|length == 1) ? 'unset' : '1px solid gray' %}
  9.                 {% set background = (activeOptions|length == 1)
  10.                     ? (activeOptions|first).colorHexCode
  11.                     : ('linear-gradient(90deg, {0} 50%, {1} 50%)'|replace({ '{0}': firstColor, '{1}': lastColor }))  %}
  12.                 {% set value = activeOptions|filter(v => v.name not in ['Ja', 'Nein', 'Yes', 'No'])|map(v => v.translated.name)|join('/') %}
  13.                 <div class="col-auto px-2">
  14.                     <span class="property-bullet-point" style="background: {{ background }}; border: {{ border }}"></span>
  15.                     <span>{{ element.translated.name|e }} {{ value }}</span>
  16.                 </div>
  17.             {% endif %}
  18.         {% endfor %}
  19.     </div>
  20. {% endblock %}