custom/plugins/TcinnThemeWareClean/src/Resources/views/storefront/element/cms-element-product-slider.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/element/cms-element-product-slider.html.twig' %}
  2. {# ThemeWare® HC-Architecture® ready #}
  3. {# ---------------- START: SET TEMPLATE VARS ---------------- #}
  4. {# ThemeWare: Set theme variables #}
  5. {% set twtProductBoxImageHoverType = theme_config('twt-product-box-image-hover-type') %}
  6. {# ---------------- END: SET TEMPLATE VARS ---------------- #}
  7. {# ThemeWare: Adjustments on the product slider element #}
  8. {% block element_product_slider_element %}
  9.     {# ThemeWare: "Hover-Bild" für Überblendungen mit dem Cover-Bild ergänzen. #}
  10.     {% if twtProductBoxImageHoverType == 10 %}
  11.         {# initial ID array #}
  12.         {% set hoverMediaIds = [] %}
  13.         {% for product in element.data.products.elements %}
  14.             {% if product.translated.customFields.twt_clean_pro_custom_field__product__hover_image is not empty %}
  15.                 {# simplify ID access #}
  16.                 {% set hoverMediaId = product.translated.customFields.twt_clean_pro_custom_field__product__hover_image %}
  17.                 {# merge IDs to a single array #}
  18.                 {% set hoverMediaIds = hoverMediaIds|merge([hoverMediaId]) %}
  19.             {% endif %}
  20.         {% endfor %}
  21.         {# do a single fetch from database #}
  22.         {% set mediaCollection = searchMedia(hoverMediaIds, context.context) %}
  23.     {% endif %}
  24.     {# Default block #}
  25.     {{ parent() }}
  26. {% endblock %}