custom/plugins/WynTheme/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_addressId %}
  3.   {% if data.get('id') %}
  4.     {# We just add class "d-none" here to keep the css simple #}
  5.     <input
  6.       type="hidden"
  7.       name="{{ prefix }}[id]"
  8.       class="d-none"
  9.       value="{{ data.get('id') }}"
  10.     />
  11.   {% endif %}
  12. {% endblock %}
  13. {% block component_address_form_company_name %}
  14.   <div class="form-group col-6 {% if prefix != "shippingAddress" and accountTypeRequired %}form-required-container{% endif %}">
  15.     {% if formViolations.getViolations("/company") is not empty %}
  16.       {% set violationPath = "/company" %}
  17.     {% elseif formViolations.getViolations("/#{prefix}/company") is not empty %}
  18.       {% set violationPath = "/#{prefix}/company" %}
  19.     {% endif %}
  20.     {% block component_address_form_company_name_label %}
  21.       {{ parent() }}
  22.     {% endblock %}
  23.     {% block component_address_form_company_name_input %}
  24.       {{ parent() }}
  25.     {% endblock %}
  26.     {% block component_address_form_company_name_input_error %}
  27.       {{ parent() }}
  28.     {% endblock %}
  29.   </div>
  30. {% endblock %}
  31. {% block component_address_form_company_vatId %}
  32.   {% if not feature('FEATURE_NEXT_15957') and showVatIdField %}
  33.     <div class="form-group col-md-6">
  34.       {% if formViolations.getViolations("/vatId") is not empty %}
  35.         {% set violationPath = "/vatId" %}
  36.       {% elseif formViolations.getViolations("/#{prefix}/vatId") is not empty %}
  37.         {% set violationPath = "/#{prefix}/vatId" %}
  38.       {% endif %}
  39.       {% block component_address_form_company_vatId_label %}
  40.         {{ parent() }}
  41.       {% endblock %}
  42.       {% block component_address_form_company_vatId_input %}
  43.         {{ parent() }}
  44.       {% endblock %}
  45.       {% block component_address_form_company_vatId_input_error %}
  46.         {{ parent() }}
  47.       {% endblock %}
  48.     </div>
  49.   {% elseif feature('FEATURE_NEXT_15957') and prefix == 'address' and showVatIdField %}
  50.     <div class="form-group col-md-6 form-required-container">
  51.       {% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
  52.         'vatIds': context.customer.vatIds
  53.       } %}
  54.     </div>
  55.   {% endif %}
  56. {% endblock %}
  57. {% block component_address_form_country_select %}
  58.   <wyn-select
  59.     class="country-select{% if violationPath %} is-invalid{% endif %}"
  60.     id="{{ idPrefix ~ prefix }}AddressCountry"
  61.     name="{{ prefix }}[countryId]"
  62.     required
  63.     data-initial-country-id="{{ initialCountryId }}"
  64.   >
  65.     {% if not initialCountryId %}
  66.       <wyn-option disabled selected value="">
  67.         {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  68.       </wyn-option>
  69.     {% endif %}
  70.     {% for country in page.countries %}
  71.       <wyn-option
  72.         {% if country.id == initialCountryId %}selected{% endif %}
  73.         value="{{ country.id }}"
  74.         data-vat-id-required="{{ country.vatIdRequired }}"
  75.         {% if feature('FEATURE_NEXT_15707') and  not country.shippingAvailable and disableNonShippableCountries %}
  76.           disabled
  77.         {% endif %}
  78.       >
  79.         {{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
  80.       </wyn-option>
  81.     {% endfor %}
  82.   </wyn-select>
  83. {% endblock %}
  84. {% block component_address_form_country_state_select %}
  85.   <wyn-select
  86.     class="country-state-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
  87.     id="{{ idPrefix ~ prefix }}AddressCountryState"
  88.     name="{{ prefix }}[countryStateId]"
  89.     data-initial-country-state-id="{{ data.get('countryStateId') }}"
  90.   >
  91.     <wyn-option value="" selected data-placeholder-option="true">
  92.       {{ "address.countryStatePlaceholder"|trans|sw_sanitize }}
  93.     </wyn-option>
  94.   </wyn-select>
  95. {% endblock %}