custom/plugins/SelfdelveCms/src/Resources/views/storefront/component/buy-widget/configurator.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/buy-widget/configurator.html.twig' %}
  2. {% block buy_widget_configurator_group %}
  3.     {% if (config('SelfdelveCms.config.configuratorCmsPageName') == page.cmsPage.name) %}
  4.         {# Group is expanded on mobile devices if non-default option is selected #}
  5.         {% set groupIsActive = false %}
  6.         {% for option in group.options %}
  7.             {% if loop.index > 1 and option.id in product.optionIds %}
  8.                 {% set groupIsActive = true %}
  9.             {% endif %}
  10.         {% endfor %}
  11.         <div class="mb-3">
  12.             <div class="w-100 group-collapse-header">
  13.                 <div class="d-flex justify-content-between align-items-center">
  14.                     <div class="h4 m-0">
  15.                         {% block buy_widget_configurator_group_title_text %}
  16.                             {{ group.translated.name }}
  17.                         {% endblock %}
  18.                     </div>
  19.                     <button type="button"
  20.                             class="btn btn-link d-inline-block d-md-none {% if groupIsActive !== true %}collapsed{% endif %}"
  21.                             data-toggle="collapse"
  22.                             data-target="#group-{{ group.id }}"
  23.                             aria-expanded="false"
  24.                     >
  25.                         <span class="group-collapse-plus">
  26.                             {% sw_icon 'plus' %}
  27.                         </span>
  28.                         <span class="group-collapse-minus">
  29.                             {% sw_icon 'minus' %}
  30.                         </span>
  31.                     </button>
  32.                 </div>
  33.             </div>
  34.             <div class="collapse d-md-block group-collapse-content {% if groupIsActive === true %}show{% endif %}" id="group-{{ group.id }}">
  35.                 <div class="row mt-2">
  36.                     {% for option in group.options %}
  37.                         {% if elementId is defined and elementId is not null %}
  38.                             {% set optionIdentifier = [group.id, option.id, elementId]|join('-') %}
  39.                         {% else %}
  40.                             {% set optionIdentifier = [group.id, option.id]|join('-') %}
  41.                         {% endif %}
  42.                         {% set isActive = false %}
  43.                         {% set isCombinableCls = 'is-combinable' %}
  44.                         {% if option.id in product.optionIds %}
  45.                             {% set isActive = true %}
  46.                         {% endif %}
  47.                         {% if not option.combinable %}
  48.                             {% set isCombinableCls = false %}
  49.                         {% endif %}
  50.                         {% if option.configuratorSetting.media %}
  51.                             {% set displayType = 'media' %}
  52.                             {% set media = option.configuratorSetting.media %}
  53.                         {% else %}
  54.                             {% set displayType = group.displayType %}
  55.                             {% if option.media %}
  56.                                 {% set media = option.media %}
  57.                             {% else %}
  58.                                 {% set media = false %}
  59.                             {% endif %}
  60.                         {% endif %}
  61.                         <div class="col-6 col-sm-4 col-md-3 col-lg-2">
  62.                             <input type="radio"
  63.                                    name="{{ group.id }}"
  64.                                    value="{{ option.id }}"
  65.                                    class="product-detail-configurator-option-input{% if isCombinableCls %} {{ isCombinableCls }}{% endif %}"
  66.                                    title="{{ optionIdentifier }}"
  67.                                    id="{{ optionIdentifier }}"
  68.                                    {% if isActive %}checked="checked"{% endif %}>
  69.                             <label class="m-0 product-detail-configurator-option-label{% if isCombinableCls %} {{ isCombinableCls }}{% endif %} is-display-{{ displayType }} overflow-hidden "
  70.                                    title="{{ option.translated.name }}"
  71.                                    for="{{ optionIdentifier }}"
  72.                             >
  73.                                 {% if media %}
  74.                                     <span class="d-flex align-items-center w-100 overflow-hidden" style="height: 90px;">
  75.                                         {% sw_thumbnails 'configurator-option-img-thumbnails' with {
  76.                                             media: media,
  77.                                             sizes: {
  78.                                                 'default': '200px'
  79.                                             },
  80.                                             attributes: {
  81.                                                 'class': 'product-detail-configurator-option-image',
  82.                                                 'alt': option.translated.name,
  83.                                                 'title': option.translated.name
  84.                                             }
  85.                                         } %}
  86.                                     </span>
  87.                                 {% endif %}
  88.                             </label>
  89.                             <div class="pt-1 pb-3 product-detail-configurator-option-title text-center">{{ option.translated.name }}</div>
  90.                         </div>
  91.                     {% endfor %}
  92.                 </div>
  93.             </div>
  94.         </div>
  95.     {% else %}
  96.         {{ parent() }}
  97.     {% endif %}
  98. {% endblock %}