custom/plugins/theme/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. {# remove required star everywhere. instead we indicate optional fields #}
  3. {% block component_address_form_street_label %}
  4.     <label class="form-label"
  5.             for="{{ prefix }}AddressStreet">
  6.         {{ "address.streetLabel"|trans|sw_sanitize }}
  7.     </label>
  8. {% endblock %}
  9. {% block component_address_form_zipcode_label %}
  10.     <label class="form-label"
  11.             for="{{ prefix }}AddressZipcode">
  12.         {{ "address.zipcodeLabel"|trans|sw_sanitize }}
  13.     </label>
  14. {% endblock %}
  15. {% block component_address_form_city_label %}
  16.     <label class="form-label"
  17.             for="{{ prefix }}AddressCity">
  18.         {{ "address.cityLabel"|trans|sw_sanitize }}
  19.     </label>
  20. {% endblock %}
  21. {% block component_address_form_phone_number_label %}
  22.     <label class="form-label"
  23.             for="{{ prefix }}AddressPhoneNumber">
  24.         {{ "address.phoneNumberLabel"|trans|sw_sanitize }}<span class="form-label-optional">{{"form.label.optional"|trans|sw_sanitize}}</span>
  25.     </label>
  26. {% endblock %}
  27. {# remove state #}
  28. {% block component_address_form_country %}
  29.     <div class="form-group col-md-6">
  30.         {% set initialCountryId = null %}
  31.         {% if data.get('countryId') %}
  32.             {% set initialCountryId = data.get('countryId') %}
  33.         {% elseif page.countries|length == 1 %}
  34.             {% set initialCountryId = (page.countries|first).id %}
  35.         {% endif %}
  36.         {% if formViolations.getViolations("/countryId") is not empty %}
  37.             {% set violationPath = "/countryId" %}
  38.         {% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
  39.             {% set violationPath = "/#{prefix}/countryId" %}
  40.         {% endif %}
  41.         {% block component_address_form_country_label %}
  42.             <label class="form-label"
  43.                     for="{{ prefix }}AddressCountry">
  44.                 {{ "address.countryLabel"|trans|sw_sanitize }}
  45.             </label>
  46.         {% endblock %}
  47.         {% block component_address_form_country_select %}
  48.             {{ parent() }}
  49.         {% endblock %}
  50.         {% block component_address_form_country_error %}
  51.             {{ parent() }}
  52.         {% endblock %}
  53.     </div>
  54. {% endblock %}