{% block zenit_floating_buybox_configurator_groups_toggle %}
{% block zenit_floating_buybox_configurator_groups_toggle_mobile %}
<button class="product-detail-configurator-groups-toggle js-configurator-grouped-groups-toggle btn" data-toggle="collapse" data-target="#buybox-floating-configurator-grouped" role="button" aria-expanded="false" aria-controls="buybox-floating-configurator-grouped">
{% sw_icon 'arrow-medium-up' style {
'pack': 'solid', 'size': 'xs', 'class': 'configurator-groups-toggle'
} %}
<div class="product-detail-configurator-groups-toggle-label">
<div class="product-detail-configurator-option-text">
{{ 'zenitAppFloatingBuybox.groupsToggleBtn.title'|trans }}
</div>
</div>
</button>
{% endblock %}
{% block zenit_floating_buybox_configurator_groups_toggle_groups %}
{% for group in page.configuratorSettings %}
{% for option in group.options %}
{% set isActive = false %}
{% if option.id in page.product.optionIds %}
{% set isActive = true %}
{% endif %}
{% if option.configuratorSetting.media %}
{% set displayType = 'media' %}
{% set media = option.configuratorSetting.media %}
{% else %}
{% set displayType = group.displayType %}
{% if option.media %}
{% set media = option.media %}
{% else %}
{% set media = false %}
{% endif %}
{% endif %}
{% if displayType == 'color' and not option.colorHexCode or
displayType == 'media' and not media %}
{% set displayType = 'text' %}
{% endif %}
{% block zenit_floating_buybox_configurator_groups_toggle_preview %}
{% if isActive %}
<button class="product-detail-configurator-groups-toggle js-configurator-groups-toggle btn is-display-{{ displayType }}" data-toggle="collapse" data-target="#{{ group.translated.name }}-{{ group.id }}" role="button" aria-expanded="false" aria-controls="{{ group.translated.name }}-{{ group.id }}">
{% sw_icon 'arrow-medium-up' style {
'pack': 'solid', 'size': 'xs', 'class': 'configurator-groups-toggle'
} %}
<div class="product-detail-configurator-groups-toggle-label">
{% if displayType == 'color' and option.colorHexCode %}
<div class="product-detail-configurator-option-color" style="background-color: {{ option.colorHexCode }}"></div>
{% endif %}
{% if displayType == 'media' and media %}
<div class="product-detail-configurator-option-media">
{% sw_thumbnails 'configurator-option-img-thumbnails' with {
media: media,
sizes: {
'default': '52px'
},
attributes: {
'class': 'product-detail-configurator-option-image',
'alt': option.translated.name,
'title': option.translated.name
}
} %}
</div>
{% elseif displayType == 'text' or
displayType == 'select' or
(displayType == 'media' and not media) or
(displayType == 'color' and not option.colorHexCode) %}
{% block page_product_detail_configurator_option_radio_label_text %}
<div class="product-detail-configurator-option-text">{{ option.translated.name }}</div>
{% endblock %}
{% endif %}
</div>
</button>
{% endif %}
{% endblock %}
{% endfor %}
{% endfor %}
{% endblock %}
{% endblock %}