{% block plugins_maxia_listing_variants_configurator_options %}
{% set groupConfig = group.extensions.maxiaListingVariants %}
{% set formPrefix = random() %}
{% if group.displayType == 'dropdown' or group.displayType == 'select' %}
{% block plugins_maxia_listing_variants_configurator_option_dropdown_include %}
{% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/dropdown.html.twig' %}
{% endblock %}
{% else %}
{# Radio based layouts #}
{% block plugins_maxia_listing_variants_configurator_option_radio %}
{% set break = false %}
{% for option in group.options %}
{% if not break %}
{% set optionIdentifier = formPrefix ~ '-' ~ ([group.id, option.id]|join('-')) %}
{% set isActive = false %}
{% set isCombinableCls = 'is-combinable' %}
{% if not option.combinable and baseConfig.markSoldOutCloseoutProducts %}
{% set isCombinableCls = false %}
{% 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 variantsConfig.quickBuyActive and option.id in product.optionIds %}
{% set isActive = true %}
{% endif %}
{% if limit and groupConfig.maxEntries < groupConfig.totalEntries and loop.index == groupConfig.maxEntries %}
{% set break = true %}
{% endif %}
{% set variant = variantsConfig.optionProductMappings[option.id] %}
{% if not variant.productId %}
{% set variant = { productId: product.id, entity: product } %}
{% endif %}
{% block plugins_maxia_listing_variants_configurator_option_radio_inner %}
{% block plugins_maxia_listing_variants_configurator_option_radio_element %}
{% set tagName = variantsConfig.quickBuyActive ? 'div' : 'a' %}
<{{ tagName }} class="product-detail-configurator-option"
{% if not variantsConfig.quickBuyActive %}
href="{{ seoUrl('frontend.detail.page', {'productId': variant.productId }) }}"
{% else %}
data-url="{{ seoUrl('frontend.detail.page', {'productId': variant.productId}) }}"
{% endif %}
>
{% block plugins_maxia_listing_variants_configurator_option_radio_include %}
{% if displayType == 'list' %}
{% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/list.html.twig' %}
{% else %}
{% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/radio.html.twig' with {
media: media,
displayType: displayType
} %}
{% endif %}
{% endblock %}
</{{ tagName }}>
{% endblock %}
{% block plugins_maxia_listing_variants_configurator_option_radio_expand_button %}
{% if break %}
{% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/expand-button.html.twig' with {
remainingEntries: groupConfig.totalEntries - loop.index,
displayType: displayType
} %}
{% endif %}
{% endblock %}
{% endblock %}
{% endif %}
{% endfor %}
{% endblock %}
{% endif %}
{% endblock %}