custom/plugins/MaxiaListingVariants6/src/Resources/views/storefront/plugins/maxia_listing_variants/configurator-options.html.twig line 1

Open in your IDE?
  1. {% block plugins_maxia_listing_variants_configurator_options %}
  2.     {% set groupConfig = group.extensions.maxiaListingVariants %}
  3.     {% set formPrefix = random() %}
  4.     {% if group.displayType == 'dropdown' or group.displayType == 'select' %}
  5.         {% block plugins_maxia_listing_variants_configurator_option_dropdown_include %}
  6.             {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/dropdown.html.twig' %}
  7.         {% endblock %}
  8.     {% else %}
  9.         {# Radio based layouts #}
  10.         {% block plugins_maxia_listing_variants_configurator_option_radio %}
  11.             {% set break = false %}
  12.             {% for option in group.options %}
  13.                 {% if not break %}
  14.                     {% set optionIdentifier = formPrefix ~ '-' ~ ([group.id, option.id]|join('-')) %}
  15.                     {% set isActive = false %}
  16.                     {% set isCombinableCls = 'is-combinable' %}
  17.                     {% if not option.combinable and baseConfig.markSoldOutCloseoutProducts %}
  18.                         {% set isCombinableCls = false %}
  19.                     {% endif %}
  20.                     {% if option.configuratorSetting.media %}
  21.                         {% set displayType = 'media' %}
  22.                         {% set media = option.configuratorSetting.media %}
  23.                     {% else %}
  24.                         {% set displayType = group.displayType %}
  25.                         {% if option.media %}
  26.                             {% set media = option.media %}
  27.                         {% else %}
  28.                             {% set media = false %}
  29.                         {% endif %}
  30.                     {% endif %}
  31.                     {% if variantsConfig.quickBuyActive and option.id in product.optionIds %}
  32.                         {% set isActive = true %}
  33.                     {% endif %}
  34.                     {% if limit and groupConfig.maxEntries < groupConfig.totalEntries and loop.index == groupConfig.maxEntries  %}
  35.                         {% set break = true %}
  36.                     {% endif %}
  37.                     {% set variant = variantsConfig.optionProductMappings[option.id] %}
  38.                     {% if not variant.productId %}
  39.                         {% set variant = { productId: product.id, entity: product } %}
  40.                     {% endif %}
  41.                     {% block plugins_maxia_listing_variants_configurator_option_radio_inner %}
  42.                         {% block plugins_maxia_listing_variants_configurator_option_radio_element %}
  43.                             {% set tagName = variantsConfig.quickBuyActive ? 'div' : 'a' %}
  44.                             <{{ tagName }} class="product-detail-configurator-option"
  45.                             {% if not variantsConfig.quickBuyActive %}
  46.                                 href="{{ seoUrl('frontend.detail.page', {'productId': variant.productId }) }}"
  47.                             {% else %}
  48.                                 data-url="{{ seoUrl('frontend.detail.page', {'productId': variant.productId}) }}"
  49.                             {% endif %}
  50.                             >
  51.                             {% block plugins_maxia_listing_variants_configurator_option_radio_include %}
  52.                                 {% if displayType == 'list' %}
  53.                                     {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/list.html.twig' %}
  54.                                 {% else %}
  55.                                     {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/layouts/radio.html.twig' with {
  56.                                         media: media,
  57.                                         displayType: displayType
  58.                                     } %}
  59.                                 {% endif %}
  60.                             {% endblock %}
  61.                             </{{ tagName }}>
  62.                         {% endblock %}
  63.                         {% block plugins_maxia_listing_variants_configurator_option_radio_expand_button %}
  64.                             {% if break %}
  65.                                 {% sw_include '@Storefront/storefront/plugins/maxia_listing_variants/expand-button.html.twig' with {
  66.                                     remainingEntries: groupConfig.totalEntries - loop.index,
  67.                                     displayType: displayType
  68.                                 } %}
  69.                             {% endif %}
  70.                         {% endblock %}
  71.                     {% endblock %}
  72.                 {% endif %}
  73.             {% endfor %}
  74.         {% endblock %}
  75.     {% endif %}
  76. {% endblock %}