custom/plugins/GrimmTheme/src/Resources/views/storefront/page/product-detail/configurator.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/configurator.html.twig' %}
  2. {% block page_product_detail_configurator_options %}
  3.     <div class="product-detail-configurator-options">
  4.         {% for option in group.options %}
  5.             {% set optionIdentifier = [group.id, option.id]|join('-') %}
  6.             {% set isActive = false %}
  7.             {% set isCombinableCls = 'is-combinable' %}
  8.             {% if option.id in page.product.optionIds %}
  9.                 {% set isActive = true %}
  10.             {% endif %}
  11.             {% if not option.combinable %}
  12.                 {% set isCombinableCls = false %}
  13.             {% endif %}
  14.             {% if option.configuratorSetting.media %}
  15.                 {% set displayType = 'media' %}
  16.                 {% set media = option.configuratorSetting.media %}
  17.             {% else %}
  18.                 {% set displayType = group.displayType %}
  19.                 {% if option.media %}
  20.                     {% set media = option.media %}
  21.                 {% else %}
  22.                     {% set media = false %}
  23.                 {% endif %}
  24.             {% endif %}
  25.             {% block page_product_detail_configurator_option %}
  26.                 <div class="product-detail-configurator-option">
  27.                     {% block page_product_detail_configurator_option_radio %}
  28.                         <input type="radio"
  29.                                name="{{ group.id }}"
  30.                                value="{{ option.id }}"
  31.                                class="product-detail-configurator-option-input{% if isCombinableCls %} {{ isCombinableCls }}{% endif %}"
  32.                                title="{{ optionIdentifier }}"
  33.                                id="{{ optionIdentifier }}"
  34.                                {% if isActive %}checked="checked"{% endif %}>
  35.                         {% block page_product_detail_configurator_option_radio_label %}
  36.                             <label class="product-detail-configurator-option-label{% if isCombinableCls %} {{ isCombinableCls }}{% endif %} is-display-{{ displayType }}"
  37.                                 {% if displayType == 'color' and option.colorHexCode %}
  38.                                     style="background-color: {{ option.colorHexCode }}"
  39.                                 {% endif %}
  40.                                    title="{{ option.translated.name }}"
  41.                                    for="{{ optionIdentifier }}">
  42.                                 {% if displayType == 'media' and media %}
  43.                                     {% block page_product_detail_configurator_option_radio_label_media %}
  44.                                         {% sw_thumbnails 'configurator-option-img-thumbnails' with {
  45.                                             media: media,
  46.                                             sizes: {
  47.                                                 'default': '52px'
  48.                                             },
  49.                                             attributes: {
  50.                                                 'class': 'product-detail-configurator-option-image',
  51.                                                 'alt': option.translated.name,
  52.                                                 'title': option.translated.name
  53.                                             }
  54.                                         } %}
  55.                                     {% endblock %}
  56.                                 {% elseif displayType == 'text' or
  57.                                     (displayType == 'media' and not media) or
  58.                                     (displayType == 'color' and not option.colorHexCode) %}
  59.                                     {% block page_product_detail_configurator_option_radio_label_text %}
  60.                                         {{ option.translated.name }}
  61.                                     {% endblock %}
  62.                                 {% endif %}
  63.                             </label>
  64.                         {% endblock %}
  65.                     {% endblock %}
  66.                 </div>
  67.             {% endblock %}
  68.         {% endfor %}
  69.     </div>
  70. {% endblock %}