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

Open in your IDE?
  1. {% block page_product_detail_configurator_group_select %}
  2.     {% block page_product_detail_configurator_group_select_title %}
  3.         {% set currentUrl = app.request.attributes.get("sw-original-request-uri") %}
  4.             {% if currentUrl starts with '/widgets/cms/buybox' %}
  5.         <label class="product-detail-configurator-group-title" for="{{ group.id }}" style="font-size: 16px !important; color: black !important;">
  6.             {% else %}
  7.         <label class="product-detail-configurator-group-title" for="{{ group.id }}" style="font-size: 22px !important; color: black !important;">
  8.             {% endif %}
  9.             {% block page_product_detail_configurator_group_title_text %}
  10.                 {{ group.translated.name }}
  11.             {% endblock %}
  12.         </label>
  13.         {% set defaultOption = false %}
  14.         {% if currentUrl|slice(-1) == '0' %}
  15.           {% set defaultOption = true %}
  16.         {% endif %}
  17.         {% block page_product_detail_configurator_select %}
  18.             {% if page.cmsPage.type == 'landingpage' and 'minisolar' in page.cmsPage.name %}
  19.             {% endif %}
  20.             {% if currentUrl starts with '/widgets/cms/buybox' %}
  21. {# fühlt sich sehr nach Hack an #}
  22.                 {% set selectedOptionBuyBox = app.request.get('options')[-34:-2] %}
  23.             {% else %}
  24.                 {% set selectedOptionBuyBox = '' %}
  25.             {% endif %}
  26.                 <select name="{{ group.id }} configuratorId" id="{{ group.id }}"
  27.                         class="{{ formSelectClass }} product-detail-configurator-select-input configuratorSelectClass">
  28.                     {% if not data.get(group.id) and defaultOption != "" %}
  29.                         <option data-default-option="{{ defaultOption }}" selected="selected"
  30.                                 value="">
  31.                             {{ "emova.label.selectAnOptionPlaceHolder"|trans|sw_sanitize }}
  32.                         </option>
  33.                     {% endif %}
  34.                     {% for option in group.options %}
  35.                         {% set selected = false %}
  36.                         {% if defaultOption == false %}
  37.                             {% if option.id in page.product.optionIds %}
  38.                                 {% set selected = true %}
  39.                             {% endif %}
  40.                             {% if option.id in product.optionIds %}
  41.                                 {% set selected = true %}
  42.                             {% endif %}
  43.                         {% endif %}
  44.                         {% block page_product_detail_configurator_select_option %}
  45.                             <option data-default-option="{{ defaultOption }}" {% if selected == true or option.id == data.get(group.id) or option.id == selectedOptionBuyBox %}
  46.                                 selected="selected"
  47.                             {% endif %}
  48.                                     value="{{ option.id }}">
  49.                                 {{ option.translated.name }}
  50.                             </option>
  51.                         {% endblock %}
  52.                     {% endfor %}
  53.                 </select>
  54.         {% endblock %}
  55.     {% endblock %}
  56. {% endblock %}