{% sw_extends '@Storefront/storefront/component/address/address-form.html.twig' %}
{# remove required star everywhere. instead we indicate optional fields #}
{% block component_address_form_street_label %}
<label class="form-label"
for="{{ prefix }}AddressStreet">
{{ "address.streetLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_zipcode_label %}
<label class="form-label"
for="{{ prefix }}AddressZipcode">
{{ "address.zipcodeLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_city_label %}
<label class="form-label"
for="{{ prefix }}AddressCity">
{{ "address.cityLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_phone_number_label %}
<label class="form-label"
for="{{ prefix }}AddressPhoneNumber">
{{ "address.phoneNumberLabel"|trans|sw_sanitize }}<span class="form-label-optional">{{"form.label.optional"|trans|sw_sanitize}}</span>
</label>
{% endblock %}
{# remove state #}
{% block component_address_form_country %}
<div class="form-group col-md-6">
{% set initialCountryId = null %}
{% if data.get('countryId') %}
{% set initialCountryId = data.get('countryId') %}
{% elseif page.countries|length == 1 %}
{% set initialCountryId = (page.countries|first).id %}
{% endif %}
{% if formViolations.getViolations("/countryId") is not empty %}
{% set violationPath = "/countryId" %}
{% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
{% set violationPath = "/#{prefix}/countryId" %}
{% endif %}
{% block component_address_form_country_label %}
<label class="form-label"
for="{{ prefix }}AddressCountry">
{{ "address.countryLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_country_select %}
{{ parent() }}
{% endblock %}
{% block component_address_form_country_error %}
{{ parent() }}
{% endblock %}
</div>
{% endblock %}