{% sw_extends '@Storefront/storefront/element/cms-element-image-gallery.html.twig' %}
{% block element_image_gallery_alignment %}
{{ parent() }}
{% set price = page.product.calculatedPrice %}
{% if page.product.calculatedPrices|length == 1 %}
{% set price = page.product.calculatedPrices.first %}
{% endif %}
{% set listPrice = price.listPrice %}
{% set isListPrice = listPrice.percentage >= 10 %}
{% if isListPrice %}
{% sw_include '@Storefront/storefront/themeware/includes/twt-badge-discount-include.html.twig' ignore missing with {
product: page.product,
type: 'listing'
} %}
{% endif %}
{% endblock %}
{% block element_image_gallery_inner_item %}
<div class="gallery-slider-item-container">
<div class="gallery-slider-item is-{{ displayMode }} js-magnifier-container" {% if minHeight and (displayMode == "cover" or displayMode == "contain" ) %} style="min-height: {{ minHeight }}" {% endif %}>
{% set image_name = page.product.translated.name %}
{% if page.product.parentId and page.configuratorSettings|length > 0 %}
{% for group in page.configuratorSettings %}
{% for option in group.options %}
{% if option.id in page.product.optionIds %}
{% set image_name = image_name ~ " " ~ option.translated.name %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% set image_name = image_name ~ " " ~ loop.index %}
{% set attributes = {
'class': 'img-fluid gallery-slider-image magnifier-image js-magnifier-image',
'alt': image_name,
'title': image_name,
'data-full-image': image.url
} %}
{% if displayMode == 'cover' or displayMode == 'contain' %}
{% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
{% endif %}
{% if isProduct %}
{% set attributes = attributes|merge({ 'itemprop': 'image' }) %}
{% endif %}
{% sw_thumbnails 'gallery-slider-image-thumbnails' with {
media: image,
sizes: {
"xs" : "532px",
"sm" : "724px",
"md" : "948px",
"lg" : "657px",
"xl" : "809px",
},
attributes: attributes
} %}
</div>
</div>
{% endblock %}
{% block element_image_gallery_inner_single %}
<div class="gallery-slider-single-image is-{{ displayMode }}{% if imageCount <= 0 %} is-placeholder{% endif %} js-magnifier-container" {% if minHeight %} style="min-height: {{ imageCount > 0 ? minHeight : '430px' }}" {% endif %}>
{% if theme_config('zen-product-gallery-fallback-image-title') is not same as ('default') %}
{% set fallbackImageTitle = mediaItems|first.fileName %}
{% endif %}
{% if imageCount > 0 %}
{% set image_name = page.product.translated.name %}
{% if page.product.parentId and page.configuratorSettings|length > 0 %}
{% for group in page.configuratorSettings %}
{% for option in group.options %}
{% if option.id in page.product.optionIds %}
{% set image_name = image_name ~ " " ~ option.translated.name %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% set image_name = image_name ~ " 1" %}
{% set attributes = {
'class': 'img-fluid gallery-slider-image magnifier-image js-magnifier-image',
'alt': image_name,
'title': image_name,
'data-full-image': mediaItems|first.url
} %}
{% if displayMode == 'cover' or displayMode == 'contain' %}
{% set attributes = attributes|merge({ 'data-object-fit': displayMode }) %}
{% endif %}
{% if isProduct %}
{% set attributes = attributes|merge({ 'itemprop': 'image' }) %}
{% endif %}
{# ... enables lazy loading for images #}
{% if config('zenitPlatformStratus.config.lazyloading') %}
{% set attributes = attributes|merge({ 'loading': 'lazy' }) %}
{% endif %}
{% sw_thumbnails 'gallery-slider-image-thumbnails' with {
media: mediaItems|first,
sizes: {
"xs" : "532px",
"sm" : "724px",
"md" : "948px",
"lg" : "657px",
"xl" : "809px",
},
attributes: attributes
} %}
{% else %}
{% sw_icon 'placeholder' style {
'size': 'fluid'
} %}
{% endif %}
</div>
{% endblock %}
{% block element_image_gallery_inner_thumbnails_item_inner %}
<div class="gallery-slider-thumbnails-item-inner">
{% set image_name = "Vorschau: " ~ page.product.translated.name %}
{% if page.product.parentId and page.configuratorSettings|length > 0 %}
{% for group in page.configuratorSettings %}
{% for option in group.options %}
{% if option.id in page.product.optionIds %}
{% set image_name = image_name ~ " " ~ option.translated.name %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% set attributes = {
'class': 'gallery-slider-thumbnails-image',
'alt': image_name,
'title': image_name
} %}
{% if isProduct %}
{% set attributes = attributes|merge({ 'itemprop': 'image' }) %}
{% endif %}
{% sw_thumbnails 'gallery-slider-thumbnails-image-thumbnails' with {
media: image,
sizes: {
'default': '200px'
},
attributes: attributes
} %}
</div>
{% endblock %}