custom/plugins/AcrisTaxCS/src/Resources/views/storefront/component/address/address-form.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@torefront/storefront/component/address/address-form.html.twig' %}
  2. {% block component_address_form_company %}
  3.     {% if shopware.config.core.loginRegistration.showAccountTypeSelection or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
  4.         {% set isRegisterPage = false %}
  5.         {% if activeRoute in ['frontend.account.login.page', 'frontend.account.register.page', 'frontend.checkout.register.page'] %}
  6.             {% set isRegisterPage = true %}
  7.         {% endif %}
  8.         {% if isRegisterPage %}
  9.             <div class="js-field-toggle-contact-type-company d-none">
  10.                 <input type="hidden">
  11.             </div>
  12.         {% endif %}
  13.     {% endif %}
  14.     {{ parent() }}
  15. {% endblock %}
  16. {% block component_address_form_country_select %}
  17.     {% set defaultCountriesEU = constant('Acris\\Tax\\Components\\Service\\VatIdValidationService::DEFAULT_SPECIFIC_COUNTRIES') %}
  18.     {% if config('AcrisTaxCS.config').VatIDRequiredAllEUCountries == 'enableForAllEuCountries' %}
  19.         {% for country in page.countries %}
  20.             {% if country.getIso() in defaultCountriesEU %}
  21.                 {% do country.setVatIdRequired(true) %}
  22.             {% endif %}
  23.         {% endfor %}
  24.     {% endif %}
  25.     {% if config('AcrisTaxCS.config').VatIDRequiredAllEUCountries == 'disableForAllEuCountries' %}
  26.         {% for country in page.countries %}
  27.             {% if country.getIso() in defaultCountriesEU %}
  28.                 {% do country.setVatIdRequired(false) %}
  29.             {% endif %}
  30.         {% endfor %}
  31.     {% endif %}
  32.     {# is needed to increase compatibility with AcrisCountries #}
  33.     {% set hasAddress = false %}
  34.     {% if block('component_address_form_country_select_acris_countries') is defined %}
  35.         {% if address or data %}
  36.             {% set hasAddress = true %}
  37.         {% endif %}
  38.         <div class="acris-countries"
  39.         data-acris-countries="true"
  40.         data-acris-countries-options='{
  41.                                         "zipcodeValidationActive": "{{ config('AcrisCountries.config').validate }}",
  42.                                         "prefix": "{{ prefix }}",
  43.                                         "hasAddress": "{{ hasAddress }}"
  44.                                         }'>
  45.     {% endif %}
  46.     {% if prefix == 'shippingAddress' or prefix == 'address' %}
  47.         <select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
  48.                 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 %}"
  49.                 name="{{ prefix }}[countryId]"
  50.                 required="required"
  51.                 data-initial-country-id="{{ initialCountryId }}">
  52.             {% if not initialCountryId %}
  53.                 <option disabled="disabled"
  54.                         value=""
  55.                         selected="selected">
  56.                     {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  57.                 </option>
  58.             {% endif %}
  59.             {% for country in page.countries %}
  60.                 <option {% if country.id == initialCountryId %}
  61.                     {% if block('component_address_form_country_select_acris_countries') is defined %}
  62.                         class="acris-country-selected-input"
  63.                     {% endif %}
  64.                     selected="selected"
  65.                 {% endif %}
  66.                         {% if block('component_address_form_country_select_acris_countries') is defined %}
  67.                             acris_regex="{{ page.countries.elements[country.id].customFields['acris_countries_regex'] }}"
  68.                             acris_regex_description="{{ page.countries.elements[country.id].customFields['acris_countries_regex_description'] }}"
  69.                         {% endif %}
  70.                         value="{{ country.id }}"
  71.                         data-address-vat-id-required="{{ country.vatIdRequired }}"
  72.                         {% if feature('FEATURE_NEXT_15707') and  not country.shippingAvailable and disableNonShippableCountries %}
  73.                     disabled="disabled"
  74.                         {% endif %}>
  75.                     {{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
  76.                 </option>
  77.             {% endfor %}
  78.         </select>
  79.     {% else %}
  80.         {{ parent() }}
  81.     {% endif %}
  82.     {# is needed to increase compatibility with AcrisCountries #}
  83.     {% if block('component_address_form_country_select_acris_countries') is defined %}
  84.         </div>
  85.     {% endif %}
  86. {% endblock %}
  87. {% block component_address_form_company_department %}
  88.     {{ parent() }}
  89.     {% if config("AcrisTaxCS.config.vatIdAt") == "basicDataAndAddress" %}
  90.         <div class="form-group col-md-6">
  91.             {% sw_include '@Storefront/storefront/component/address/acris-tax-address-vat-id-field.html.twig' %}
  92.         </div>
  93.     {% endif %}
  94. {% endblock %}