custom/apps/zenitAppFloatingBuybox/Resources/views/storefront/zenit-floating-buybox/floating-buybox-configurator-groups-toggle.html.twig line 1

Open in your IDE?
  1. {% block zenit_floating_buybox_configurator_groups_toggle %}
  2.     {% block zenit_floating_buybox_configurator_groups_toggle_mobile %}
  3.         <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">
  4.             {% sw_icon 'arrow-medium-up' style {
  5.                 'pack': 'solid', 'size': 'xs', 'class': 'configurator-groups-toggle'
  6.             } %}
  7.             <div class="product-detail-configurator-groups-toggle-label">
  8.                 <div class="product-detail-configurator-option-text">
  9.                     {{ 'zenitAppFloatingBuybox.groupsToggleBtn.title'|trans }}
  10.                 </div>
  11.             </div>
  12.         </button>
  13.     {% endblock %}
  14.     {% block zenit_floating_buybox_configurator_groups_toggle_groups %}
  15.         {% for group in page.configuratorSettings %}
  16.             {% for option in group.options %}
  17.                 {% set isActive = false %}
  18.                 {% if option.id in page.product.optionIds %}
  19.                     {% set isActive = true %}
  20.                 {% endif %}
  21.                 {% if option.configuratorSetting.media %}
  22.                     {% set displayType = 'media' %}
  23.                     {% set media = option.configuratorSetting.media %}
  24.                 {% else %}
  25.                     {% set displayType = group.displayType %}
  26.                     {% if option.media %}
  27.                         {% set media = option.media %}
  28.                     {% else %}
  29.                         {% set media = false %}
  30.                     {% endif %}
  31.                 {% endif %}
  32.                 {% if displayType == 'color' and not option.colorHexCode or
  33.                     displayType == 'media' and not media %}
  34.                     {% set displayType = 'text' %}
  35.                 {% endif %}
  36.                 {% block zenit_floating_buybox_configurator_groups_toggle_preview %}
  37.                     {% if isActive %}
  38.                         <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 }}">
  39.                         {% sw_icon 'arrow-medium-up' style {
  40.                             'pack': 'solid', 'size': 'xs', 'class': 'configurator-groups-toggle'
  41.                         } %}
  42.                             <div class="product-detail-configurator-groups-toggle-label">
  43.                                 {% if displayType == 'color' and option.colorHexCode %}
  44.                                     <div class="product-detail-configurator-option-color" style="background-color: {{ option.colorHexCode }}"></div>
  45.                                 {% endif %}
  46.                                 {% if displayType == 'media' and media %}
  47.                                     <div class="product-detail-configurator-option-media">
  48.                                         {% sw_thumbnails 'configurator-option-img-thumbnails' with {
  49.                                             media: media,
  50.                                             sizes: {
  51.                                                 'default': '52px'
  52.                                             },
  53.                                             attributes: {
  54.                                                 'class': 'product-detail-configurator-option-image',
  55.                                                 'alt': option.translated.name,
  56.                                                 'title': option.translated.name
  57.                                             }
  58.                                         } %}
  59.                                     </div>
  60.                                 {% elseif displayType == 'text' or
  61.                                     displayType == 'select' or
  62.                                     (displayType == 'media' and not media) or
  63.                                     (displayType == 'color' and not option.colorHexCode) %}
  64.                                     {% block page_product_detail_configurator_option_radio_label_text %}
  65.                                         <div class="product-detail-configurator-option-text">{{ option.translated.name }}</div>
  66.                                     {% endblock %}
  67.                                 {% endif %}
  68.                             </div>
  69.                         </button>
  70.                     {% endif %}
  71.                 {% endblock %}
  72.             {% endfor %}
  73.         {% endfor %}
  74.     {% endblock %}
  75. {% endblock %}