custom/plugins/MwProductCustomerInputs/src/Resources/views/storefront/page/product-detail/buy-widget.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/page/product-detail/buy-widget.html.twig' %}
  2. {% set mwRequiredFieldIsPossible = 1 %}
  3. {% block page_product_detail_configurator_include %}
  4.     {{ parent() }}
  5.     {% block page_product_detail_configurator_include_customerinput %}
  6.         {% set extension = page.product.extensions %}
  7.         {% set mwCustomerInputCountValue = extension['mwCustomerInputCountValue'].value %}
  8.         {% set mwCustomerInputActiveValues = 0 %}
  9.         {% for mwCustomerInputCount in 1..mwCustomerInputCountValue %}
  10.             {% set productId = page.product.id %}
  11.             {% set productNumber = page.product.productNumber %}
  12.             {% set mwCustomerInputValue = extension['mwCustomerInput' ~ mwCustomerInputCount].value %}
  13.             {% set requiredFormName = 'productDetailPageBuyProductForm' %}
  14.             {% set customFields = page.product.translated.customFields %}
  15.             {% set mwCustomerInputActive = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_active' %}
  16.             {% set mwCustomerInputFieldtype = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_fieldtype' %}
  17.             {% set mwCustomerInputTitle = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_title' %}
  18.             {% set mwCustomerInputPlaceholder = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_placeholder' %}
  19.             {% set mwCustomerInputRequired = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_required' %}
  20.             {% set mwCustomerInputMinvalue = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_minvalue' %}
  21.             {% set mwCustomerInputMaxvalue = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_maxvalue' %}
  22.             {% set mwCustomerInputStepvalue = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_stepsvalue' %}
  23.             {% set mwCustomerInputStartdate = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_startdate' %}
  24.             {% set mwCustomerInputEnddate = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_enddate' %}
  25.             {% set mwCustomerInputDisableddates = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_disableddates' %}
  26.             {% set mwCustomerInputStarttime = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_starttime' %}
  27.             {% set mwCustomerInputEndtime = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_endtime' %}
  28.             {% set mwCustomerInputDaterange = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_daterange' %}
  29.             {% set mwCustomerInputSelectfieldvalues = 'mw_customer_input_' ~ mwCustomerInputCount ~ '_selectfieldvalues' %}
  30.             {% if customFields[mwCustomerInputActive] and config('MwProductCustomerInputs.config.mwCustomerInputShowOnProductDetailPage') and ((customFields[mwCustomerInputFieldtype] == "select" and customFields[mwCustomerInputSelectfieldvalues]) or (customFields[mwCustomerInputFieldtype] != "select")) %}
  31.                 <form id="productCustomerInputForm-{{ productId }}-{{ mwCustomerInputCount }}" class="mw-customer-input-detail-box-form{% if config('MwProductCustomerInputs.config.mwCustomerInputHighlightRequiredFieldInColor') and (customFields[mwCustomerInputRequired]) %} was-validated{% endif %}" action="{{ path('frontend.savecustomerinputs.request') }}" method="post"><div class="form-group row">
  32.                     {{ sw_csrf('frontend.detail.mw-customer-input') }}
  33.                     {% if customFields[mwCustomerInputFieldtype] == "input" or customFields[mwCustomerInputFieldtype] == "textarea" or customFields[mwCustomerInputFieldtype] == "datetime" or customFields[mwCustomerInputFieldtype] == "date" or customFields[mwCustomerInputFieldtype] == "time" or customFields[mwCustomerInputFieldtype] == "select" or customFields[mwCustomerInputFieldtype] == "number" %}<label class="col-sm-4 col-form-label" for="mw-customer-input-value-{{ productId }}-{{ mwCustomerInputCount }}">{% elseif customFields[mwCustomerInputFieldtype] == "boolean" %}<div class="col-sm-4 col-form-label">{% endif %}
  34.                         {% if customFields[mwCustomerInputTitle] %}
  35.                             {{ customFields[mwCustomerInputTitle] }}
  36.                         {% else %}
  37.                             {{ "mw.mwCustomerInput.titleLabel"|trans|raw }}
  38.                         {% endif %}
  39.                     {% if customFields[mwCustomerInputFieldtype] == "input" or customFields[mwCustomerInputFieldtype] == "textarea" or customFields[mwCustomerInputFieldtype] == "datetime" or customFields[mwCustomerInputFieldtype] == "date" or customFields[mwCustomerInputFieldtype] == "time" or customFields[mwCustomerInputFieldtype] == "select" or customFields[mwCustomerInputFieldtype] == "number" %}</label>{% elseif customFields[mwCustomerInputFieldtype] == "boolean" %}</div>{% endif %}
  40.                     <div class="col-sm-8 {% if customFields[mwCustomerInputFieldtype] == "input" or customFields[mwCustomerInputFieldtype] == "textarea" or customFields[mwCustomerInputFieldtype] == "datetime" or customFields[mwCustomerInputFieldtype] == "date" or customFields[mwCustomerInputFieldtype] == "time" or customFields[mwCustomerInputFieldtype] == "select" %}input-group{% elseif customFields[mwCustomerInputFieldtype] == "boolean" %}custom-control custom-checkbox{% endif %}">
  41.                         {% sw_include '@MwProductCustomerInputs/storefront/page/product-detail/buy-widget-customer-input-fields.html.twig' with {
  42.                             prefix: ""
  43.                         } %}
  44.                     </div>
  45.                     {% if customFields[mwCustomerInputRequired] %}
  46.                         <div class="col-sm-12"><small class="form-text required-text{% if customFields[mwCustomerInputFieldtype] == "boolean" %} is-checkbox{% endif %}">
  47.                             {{ "mw.mwCustomerInput.requiredLabel"|trans|raw }}
  48.                         </small></div>
  49.                         <br/>
  50.                     {% endif %}
  51.                 </div></form>
  52.             {% endif %}
  53.             {% if customFields[mwCustomerInputActive] %}
  54.                 {% set mwCustomerInputActiveValues = mwCustomerInputActiveValues + 1 %}
  55.             {% endif %}
  56.         {% endfor %}
  57.         {% if (config('MwProductCustomerInputs.config.mwCustomerInputShowInformationMessage')) and (mwCustomerInputActiveValues > 0) %}
  58.             {% block page_product_detail_configurator_include_customerinput_informationmessage %}
  59.                 <div role="alert"
  60.                      class="alert alert-info alert-has-icon mw-customer-input-alert-info">
  61.                     {% sw_icon 'info' %}
  62.                     <div class="alert-content-container">
  63.                         <div class="alert-content">
  64.                             {{ "mw.mwCustomerInput.informationMessage"|trans|raw }}
  65.                         </div>
  66.                     </div>
  67.                 </div>
  68.             {% endblock %}
  69.         {% endif %}
  70.     {% endblock %}
  71. {% endblock %}