custom/plugins/ProcWegReg/src/Resources/views/storefront/component/address/address-form.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/address/address-form.html.twig' %}
  2. {% block component_address_form_additional_field1 %}
  3. <div class="col-12 form-row country-and-state-form-elements" data-country-state-select="true">
  4.     {% if config('core.loginRegistration.showAdditionalAddressField1') %}
  5.         {% if formViolations.getViolations("/additionalAddressLine1") is not empty %}
  6.             {% set violationPath = "/additionalAddressLine1" %}
  7.         {% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine1") is not empty %}
  8.             {% set violationPath = "/#{prefix}/additionalAddressLine1" %}
  9.         {% endif %}
  10.         <div class="form-group col-md-4">
  11.             {% block component_address_form_additional_field1_label %}
  12.                 {{ parent() }}
  13.             {% endblock %}
  14.             {% block component_address_form_additional_field1_input %}
  15.                 {{ parent() }}
  16.             {% endblock %}
  17.             {% block component_address_form_additional_field1_error %}
  18.                 {{ parent() }}
  19.             {% endblock %}
  20.         </div>
  21.     {% endif %}
  22. {# moved content block component_address_form_country here for styling#}
  23.     <div class="form-group col-md-3 col-12">
  24.         {% set initialCountryId = null %}
  25.         {% if data.get('countryId') %}
  26.             {% set initialCountryId = data.get('countryId') %}
  27.         {% elseif page.countries|length == 1 %}
  28.             {% set initialCountryId = (page.countries|first).id %}
  29.         {% endif %}
  30.         {% if formViolations.getViolations("/countryId") is not empty %}
  31.             {% set violationPath = "/countryId" %}
  32.         {% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
  33.             {% set violationPath = "/#{prefix}/countryId" %}
  34.         {% endif %}
  35.         {% block component_address_form_country_label %}
  36.             {{ parent() }}
  37.         {% endblock %}
  38.         {% block component_address_form_country_select %}
  39.             <select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
  40.                 id="{{ idPrefix ~ prefix }}AddressCountry"
  41.                 name="{{ prefix }}[countryId]"
  42.                 required="required"
  43.                 data-initial-country-id="{{ initialCountryId }}">
  44.                     
  45.                 {% if not initialCountryId %}
  46.                     <option disabled="disabled"
  47.                             value=""
  48.                             selected="selected">
  49.                         {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  50.                     </option>
  51.                 {% endif %}
  52.                 {% for country in page.countries %}
  53.                     <option {% if country.id == initialCountryId %}
  54.                             selected="selected"
  55.                             {% endif %}
  56.                             value="{{ country.id }}"
  57.                             data-vat-id-required="{{ country.vatIdRequired }}"
  58.                             {% if feature('FEATURE_NEXT_15707') and  not country.shippingAvailable and disableNonShippableCountries %}
  59.                                 disabled="disabled"
  60.                             {% endif %}>
  61.                         {{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
  62.                     </option>
  63.                 {% endfor %}
  64.             </select>
  65.         {% endblock %}
  66.     </div>
  67.     <div class="form-group col-md-5 col-12 d-none">
  68.         {% if formViolations.getViolations("/countryStateId") is not empty %}
  69.             {% set violationPath = "/countryStateId" %}
  70.         {% elseif formViolations.getViolations("/#{prefix}/countryStateId") is not empty %}
  71.             {% set violationPath = "/#{prefix}/countryStateId" %}
  72.         {% endif %}
  73.         {% block component_address_form_country_state_label %}
  74.             {{ parent() }}
  75.         {% endblock %}
  76.         {% block component_address_form_country_state_select %}
  77.             {{ parent() }}
  78.         {% endblock %}
  79.         {% block component_address_form_country_error %}
  80.             {{ parent() }}
  81.         {% endblock %}
  82.     </div>
  83. </div>   
  84. {# end content block component_address_form_country #}
  85. {% endblock %}
  86. {% block component_address_form_country %}
  87.     
  88. {% endblock %}
  89. {% block component_address_form_phone_number %}
  90.     {% if config('core.loginRegistration.showPhoneNumberField') %}
  91.        
  92.         <div class="form-group col-md-6">
  93.             {% if formViolations.getViolations("/phoneNumber") is not empty %}
  94.                 {% set violationPath = "/phoneNumber" %}
  95.             {% elseif formViolations.getViolations("/#{prefix}/phoneNumber") is not empty %}
  96.                 {% set violationPath = "/#{prefix}/phoneNumber" %}
  97.             {% endif %}
  98.             {% block component_address_form_phone_number_label %}
  99.                 <label class="form-label"
  100.                     for="{{ idPrefix ~ prefix }}AddressPhoneNumber">
  101.                     {{ "address.phoneNumberLabel"|trans|sw_sanitize }}{{ config('core.loginRegistration.phoneNumberFieldRequired') ? "general.required"|trans|sw_sanitize }}
  102.                 </label>
  103.             {% endblock %}
  104.             {% block component_address_form_phone_number_input %}
  105.                 <input type="text"
  106.                     class="form-control"
  107.                     id="{{ idPrefix ~ prefix }}AddressPhoneNumber"
  108.                     placeholder="{{ "address.phoneNumberPlaceholder"|trans|striptags }}"
  109.                     name="{{ prefix }}[phoneNumber]"
  110.                     value="{{ data.get('phoneNumber') }}"
  111.                     {{ config('core.loginRegistration.phoneNumberFieldRequired') ? 'required="true"' }}>
  112.             {% endblock %}
  113.             {% block component_address_form_phone_error %}
  114.                 {% if violationPath %}
  115.                     {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  116.                 {% endif %}
  117.             {% endblock %}
  118.         </div>
  119.         {# <div class="form-group col-md-6">
  120.             {% block component_address_form_handy_nummer_label %}
  121.                 <label class="form-label"
  122.                     for="{{ idPrefix ~ prefix }}AddressHandyNummer">
  123.                     {{ "address.handyNummerLabel"|trans|sw_sanitize }}
  124.                 </label>
  125.             {% endblock %}
  126.             {% block component_address_form_handy_nummer_input %}
  127.                 <input type="text"
  128.                     class="form-control"
  129.                     id="{{ idPrefix ~ prefix }}AddressHandyNummer"
  130.                     placeholder="{{ "address.handyNummerPlaceholder"|trans|striptags }}"
  131.                     name="{{ prefix }}[handyNummer]"
  132.                     value="{{ data.get('handyNummer') }}"
  133.                     >
  134.             {% endblock %}
  135.         </div> #}
  136.     {% endif %}
  137. {% endblock %}