{% sw_extends '@Storefront/storefront/page/product-detail/configurator.html.twig' %}
{% block page_product_detail_configurator_option_radio_label %}
{# Add available-option class for different available/selectable states #}
{% set availableClass = 'available-option--unavailable' %}
{% if isActive %}
{# Currently selected variation #}
{% set availableClass = 'available-option--selected' %}
{% elseif isCombinableCls %}
{# The product is available in another variant in the selected group, e.g. „Medaillon“ in „250g“ in „Frisch“ is also available as „Medaillon“ in „250g“ in „Schockgefrostet“ #}
{% set availableClass = 'available-option--combinable' %}
{% elseif option.id in page.product.extension('availableOptions').all() %}
{# There is at least one available combination available for this option #}
{# E.g. „Medaillon“ in „250g“ in „Frisch“ is selected but there is a „Filet“ in "350g" in „Frisch“ #}
{# -> Available options but not combinable #}
{% set availableClass = 'available-option--available' %}
{% endif %}
<label class="product-detail-configurator-option-label available-option {% if availableClass %}{{ availableClass }}{% endif %} is-display-{{ displayType }}"
{% if displayType == 'color' and option.colorHexCode %}
style="background-color: {{ option.colorHexCode }}"
{% endif %}
title="{{ option.translated.name }}"
for="{{ optionIdentifier }}">
{% if displayType == 'media' and media %}
{% block page_product_detail_configurator_option_radio_label_media %}
{{parent()}}
{% endblock %}
{% elseif displayType == 'text' or
(displayType == 'media' and not media) or
(displayType == 'color' and not option.colorHexCode) %}
{% block page_product_detail_configurator_option_radio_label_text %}
{{ parent() }}
{% endblock %}
{% endif %}
</label>
{% endblock %}