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

  1. {% block buy_widget_configurator %}
  2. <div class="product-detail-configurator">
  3. {% if elementId is defined and elementId is not null and pageType != 'product_detail' %}
  4. {% set config = {
  5. url: url('frontend.cms.buybox.switch', { productId: product.parentId }),
  6. elementId: elementId,
  7. pageType: pageType
  8. } %}
  9. {% else %}
  10. {% set config = {
  11. url: url('frontend.detail.switch', { productId: product.parentId }),
  12. pageType: pageType
  13. } %}
  14. {% endif %}
  15. {% block buy_widget_configurator_form %}
  16. <form data-variant-switch="true" data-variant-switch-options="{{ config|json_encode }}">
  17. {# @deprecated tag:v6.5.0 - Block buy_widget_configurator_csrf will be removed. #}
  18. {% block buy_widget_configurator_csrf %}
  19. {% if elementId is defined and elementId is not null %}
  20. {{ sw_csrf('frontend.cms.buybox.switch') }}
  21. {% else %}
  22. {{ sw_csrf('frontend.detail.switch') }}
  23. {% endif %}
  24. {% endblock %}
  25. {% block buy_widget_configurator_groups %}
  26. {% for group in configuratorSettings %}
  27. {% block buy_widget_configurator_group %}
  28. <div class="product-detail-configurator-group">
  29. {% if group.displayType == 'select' %}
  30. {% sw_include '@Storefront/storefront/page/product-detail/configurator/select.html.twig' %}
  31. {% else %}
  32. {% block buy_widget_configurator_group_title %}
  33. <div class="product-detail-configurator-group-title">
  34. <div class="congiguratorname">
  35. {% block buy_widget_configurator_group_title_text %}
  36. {{ group.translated.name }}
  37. {% endblock %}
  38. </div>
  39. {% if group.translated.name == 'Größe' %}
  40. <div onclick="run('sizes')" class="informationicon">i</div>
  41. {% endif %}
  42. {% if group.translated.name == 'Size' %}
  43. <div onclick="run('sizes')" class="informationicon">i</div>
  44. {% endif %}
  45. {% if group.translated.name == 'Maat' %}
  46. <div onclick="run('sizes')" class="informationicon">i</div>
  47. {% endif %}
  48. {% if group.translated.name == 'Handschuhgröße' %}
  49. <div onclick="run('glovesizes')" class="informationicon">i</div>
  50. {% endif %}
  51. {% if group.translated.name == 'Glovesize' %}
  52. <div onclick="run('glovesizes')" class="informationicon">i</div>
  53. {% endif %}
  54. {% if group.translated.name == 'Handschoenen maat' %}
  55. <div onclick="run('glovesizes')" class="informationicon">i</div>
  56. {% endif %}
  57. <div class="clearingItem"></div>
  58. </div>
  59. {% endblock %}
  60. {% block buy_widget_configurator_options %}
  61. <div class="product-detail-configurator-options">
  62. {% for option in group.options %}
  63. {% if elementId is defined and elementId is not null %}
  64. {% set optionIdentifier = [group.id, option.id, elementId]|join('-') %}
  65. {% else %}
  66. {% set optionIdentifier = [group.id, option.id]|join('-') %}
  67. {% endif %}
  68. {% set isActive = false %}
  69. {% set isCombinableCls = 'is-combinable' %}
  70. {% if option.id in product.optionIds %}
  71. {% set isActive = true %}
  72. {% endif %}
  73. {% if not option.combinable %}
  74. {% set isCombinableCls = false %}
  75. {% endif %}
  76. {% if option.configuratorSetting.media %}
  77. {% set displayType = 'media' %}
  78. {% set media = option.configuratorSetting.media %}
  79. {% else %}
  80. {% set displayType = group.displayType %}
  81. {% if option.media %}
  82. {% set media = option.media %}
  83. {% else %}
  84. {% set media = false %}
  85. {% endif %}
  86. {% endif %}
  87. {% block buy_widget_configurator_option %}
  88. <div class="product-detail-configurator-option">
  89. {% block buy_widget_configurator_option_radio %}
  90. <input type="radio"
  91. name="{{ group.id }}"
  92. value="{{ option.id }}"
  93. class="product-detail-configurator-option-input{% if isCombinableCls %} {{ isCombinableCls }}{% endif %}"
  94. title="{{ optionIdentifier }}"
  95. id="{{ optionIdentifier }}"
  96. {% if isActive %}checked="checked"{% endif %}>
  97. {% block buy_widget_configurator_option_radio_label %}
  98. <label class="product-detail-configurator-option-label{% if isCombinableCls %} {{ isCombinableCls }}{% endif %} is-display-{{ displayType }}"
  99. {% if displayType == 'color' and option.colorHexCode and option.name != 'weiß/blau' %}
  100. style="background-color: {{ option.colorHexCode }}"
  101. {% elseif option.name == 'weiß/blau' %}
  102. style="background: linear-gradient(to bottom left, #ffffff 50%, #395f98 50%);"
  103. {% endif %}
  104. title="{{ option.translated.name }}"
  105. for="{{ optionIdentifier }}">
  106. {% if displayType == 'media' and media %}
  107. {% block buy_widget_configurator_option_radio_label_media %}
  108. {% sw_thumbnails 'configurator-option-img-thumbnails' with {
  109. media: media,
  110. sizes: {
  111. 'default': '52px'
  112. },
  113. attributes: {
  114. 'class': 'product-detail-configurator-option-image',
  115. 'alt': option.translated.name,
  116. 'title': option.translated.name
  117. }
  118. } %}
  119. {% endblock %}
  120. {% elseif displayType == 'text' or
  121. (displayType == 'media' and not media) or
  122. (displayType == 'color' and not option.colorHexCode) %}
  123. {% block buy_widget_configurator_option_radio_label_text %}
  124. {{ option.translated.name }}
  125. {% endblock %}
  126. {% endif %}
  127. </label>
  128. {% endblock %}
  129. {% endblock %}
  130. </div>
  131. {% endblock %}
  132. {% endfor %}
  133. </div>
  134. {% endblock %}
  135. {% endif %}
  136. </div>
  137. {% endblock %}
  138. {% endfor %}
  139. {% endblock %}
  140. </form>
  141. {% endblock %}
  142. <script>
  143. function run(Action) {
  144. // Creating Our XMLHttpRequest object
  145. var xhr = new XMLHttpRequest();
  146. // Making our connection
  147. var url = '{{ absolute_url(asset('bundles/theme3s/functions/getAttributesData.php')) }}&action=' + Action + '&lang={{ page.header.activeLanguage.translationCode.code }}';
  148. xhr.open("GET", url, true);
  149. var Content = "";
  150. // function execute after request is successful
  151. xhr.onreadystatechange = function () {
  152. if (this.readyState == 4 && this.status == 200) {
  153. //Content = this.responseText;
  154. $("#overlaybackground").show();
  155. $("#overlaycontent").show();
  156. $("#overlaycontent").html(this.responseText);
  157. $("body").css("overflow", "hidden");
  158. }
  159. }
  160. // Sending our request
  161. xhr.send();
  162. }
  163. </script>
  164. </div>
  165. {% endblock %}