{% 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 %}
{% if prefix == 'shippingAddress' or prefix == 'address' %}
<select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressCountry"
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 %}
selected="selected"
{% 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 %}
{% 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 %}