{% sw_extends '@torefront/storefront/component/address/address-form.html.twig' %}
{% block component_address_form_company %}
{% if shopware.config.core.loginRegistration.showAccountTypeSelection or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
{% set isRegisterPage = false %}
{% if activeRoute in ['frontend.account.login.page', 'frontend.account.register.page', 'frontend.checkout.register.page'] %}
{% set isRegisterPage = true %}
{% endif %}
{% if isRegisterPage %}
<div class="js-field-toggle-contact-type-company d-none">
<input type="hidden">
</div>
{% endif %}
{% endif %}
{{ parent() }}
{% endblock %}
{% block component_address_form_country_select %}
{% set defaultCountriesEU = constant('Acris\\Tax\\Components\\Service\\VatIdValidationService::DEFAULT_SPECIFIC_COUNTRIES') %}
{% if config('AcrisTaxCS.config').VatIDRequiredAllEUCountries == 'enableForAllEuCountries' %}
{% for country in page.countries %}
{% if country.getIso() in defaultCountriesEU %}
{% do country.setVatIdRequired(true) %}
{% endif %}
{% endfor %}
{% endif %}
{% if config('AcrisTaxCS.config').VatIDRequiredAllEUCountries == 'disableForAllEuCountries' %}
{% for country in page.countries %}
{% if country.getIso() in defaultCountriesEU %}
{% do country.setVatIdRequired(false) %}
{% endif %}
{% endfor %}
{% endif %}
{# is needed to increase compatibility with AcrisCountries #}
{% set hasAddress = false %}
{% if block('component_address_form_country_select_acris_countries') is defined %}
{% if address or data %}
{% set hasAddress = true %}
{% endif %}
<div class="acris-countries"
data-acris-countries="true"
data-acris-countries-options='{
"zipcodeValidationActive": "{{ config('AcrisCountries.config').validate }}",
"prefix": "{{ prefix }}",
"hasAddress": "{{ hasAddress }}"
}'>
{% endif %}
{% if prefix == 'shippingAddress' or prefix == 'address' %}
<select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
id="{% if block('component_address_form_country_select_acris_countries') is defined %}{{ prefix }}AddressCountry{% if address or data %}Edit{% endif %}{% else %}{{ idPrefix ~ prefix }}AddressCountry{% endif %}"
name="{{ prefix }}[countryId]"
required="required"
data-initial-country-id="{{ initialCountryId }}">
{% if not initialCountryId %}
<option disabled="disabled"
value=""
selected="selected">
{{ "address.countryPlaceholder"|trans|sw_sanitize }}
</option>
{% endif %}
{% for country in page.countries %}
<option {% if country.id == initialCountryId %}
{% if block('component_address_form_country_select_acris_countries') is defined %}
class="acris-country-selected-input"
{% endif %}
selected="selected"
{% endif %}
{% if block('component_address_form_country_select_acris_countries') is defined %}
acris_regex="{{ page.countries.elements[country.id].customFields['acris_countries_regex'] }}"
acris_regex_description="{{ page.countries.elements[country.id].customFields['acris_countries_regex_description'] }}"
{% endif %}
value="{{ country.id }}"
data-address-vat-id-required="{{ country.vatIdRequired }}"
{% if feature('FEATURE_NEXT_15707') and not country.shippingAvailable and disableNonShippableCountries %}
disabled="disabled"
{% endif %}>
{{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
</option>
{% endfor %}
</select>
{% else %}
{{ parent() }}
{% endif %}
{# is needed to increase compatibility with AcrisCountries #}
{% if block('component_address_form_country_select_acris_countries') is defined %}
</div>
{% endif %}
{% endblock %}
{% block component_address_form_company_department %}
{{ parent() }}
{% if config("AcrisTaxCS.config.vatIdAt") == "basicDataAndAddress" %}
<div class="form-group col-md-6">
{% sw_include '@Storefront/storefront/component/address/acris-tax-address-vat-id-field.html.twig' %}
</div>
{% endif %}
{% endblock %}