custom/plugins/FTBPlugin/src/Resources/views/storefront/component/plugin/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_select %}
  3.     {% set initialCountry = null %}
  4.     {% if data.get('country') %}
  5.         {% set initialCountry = data.get('country') %}
  6.     {% elseif page.countries|length == 1 %}
  7.         {% set initialCountry = (page.countries|first).iso %}
  8.     {% endif %}
  9.     <select class="country-select custom-select{% if violationPath %} is-invalid{% endif %}"
  10.             id="{{ prefix }}AddressCountry"
  11.             name="{{ prefix }}[country]"
  12.             required="required"
  13.             data-initial-country="{{ initialCountry }}">
  14.         {% if not initialCountry %}
  15.             <option disabled="disabled"
  16.                     value=""
  17.                     selected="selected">
  18.                 {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  19.             </option>
  20.         {% endif %}
  21.         {% set firstCountryId = null %}
  22.         {% for country in page.countries %}
  23.             {% if firstCountryId == null %}
  24.                 {% set firstCountryId = country.id %}
  25.             {% endif %}
  26.             <option {% if country.iso|lower == initialCountry %}
  27.                 selected="selected"
  28.             {% endif %}
  29.                     value="{{ country.iso|lower }}"
  30.                     data-vat-id-required="{{ country.vatIdRequired }}"
  31.                     {% if feature('FEATURE_NEXT_15707') and  not country.shippingAvailable and disableNonShippableCountries %}
  32.                 disabled="disabled"
  33.                     {% endif %}>
  34.                 {{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
  35.             </option>
  36.         {% endfor %}
  37.     </select>
  38.     <input type="hidden" name="{{ prefix }}[countryId]" value="{{ firstCountryId }}">
  39. {% endblock %}