custom/static-plugins/LDSCustom/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_country %}
  3.     <div class="form-group col-md-6">
  4.         {% set initialCountryId = null %}
  5.         {% if data.get('countryId') %}
  6.             {% set initialCountryId = data.get('countryId') %}
  7.         {% elseif page.countries|length == 1 and disableNonShippableCountries is not defined %}
  8.             {% set initialCountryId = (page.countries|first).id %}
  9.         {% endif %}
  10.         {% if formViolations.getViolations("/countryId") is not empty %}
  11.             {% set violationPath = "/countryId" %}
  12.         {% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
  13.             {% set violationPath = "/#{prefix}/countryId" %}
  14.         {% endif %}
  15.         {% block component_address_form_country_label %}
  16.             <label class="form-label" for="{{ idPrefix ~ prefix }}AddressCountry">
  17.                 {{ "address.countryLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
  18.             </label>
  19.         {% endblock %}
  20.         {% block component_address_form_country_select %}
  21.             <select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}" id="{{ idPrefix ~ prefix }}AddressCountry" name="{{ prefix }}[countryId]" required="required" data-initial-country-id="{{ initialCountryId }}">
  22.                 {% if not initialCountryId %}
  23.                     <option disabled="disabled" value="" selected="selected">
  24.                         {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  25.                     </option>
  26.                 {% endif %}
  27.                 {% for country in page.countries %}
  28.                     <option {% if country.id == initialCountryId %} selected="selected" {% endif %} value="{{ country.id }}" data-zipcode-required="{{ country.postalCodeRequired }}" data-vat-id-required="{{ country.vatIdRequired }}" data-state-required="{{ country.forceStateInRegistration }}" {% if feature('FEATURE_NEXT_15707') and not country.shippingAvailable and disableNonShippableCountries %} disabled="disabled" {% endif %}>
  29.                         {{ country.translated.name }}
  30.                         {% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %}
  31.                             {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}
  32.                         {% endif %}
  33.                     </option>
  34.                 {% endfor %}
  35.             </select>
  36.         {% endblock %}
  37.     </div>
  38. {% endblock %}