custom/plugins/AcrisTaxCS/src/Resources/views/storefront/component/account/register.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/account/register.html.twig' %}
  2. {% block component_account_register_form %}
  3.     {% set defaultCountriesEU = constant('Acris\\Tax\\Components\\Service\\VatIdValidationService::DEFAULT_SPECIFIC_COUNTRIES') %}
  4.     {% set countriesVatIdPattern = [] %}
  5.     {% set countriesVatIdPatternWithCountryIds = [] %}
  6.     {% set checkCountriesVatIdPattern = [] %}
  7.     {% set checkCountriesFormatPattern = [] %}
  8.     {% set checkCountryIsoCodes = [] %}
  9.     {% set countryIdsIsoCodes = [] %}
  10.     {% for country in page.countries %}
  11.         {% if country.vatIdPattern is not empty %}
  12.             {% set countriesVatIdPattern = countriesVatIdPattern|merge([country.vatIdPattern]) %}
  13.             {% set countriesVatIdPatternWithCountryIds = countriesVatIdPatternWithCountryIds|merge({(country.vatIdPattern): country.id}) %}
  14.             {% if country.translated.customFields is not empty and country.translated.customFields.acris_tax_specific_country_validate_vat_id is not empty and country.translated.customFields.acris_tax_specific_country_validate_vat_id == true %}
  15.                 {% set checkCountriesVatIdPattern = checkCountriesVatIdPattern|merge({(country.id): country.translated.customFields.acris_tax_specific_country_validate_vat_id}) %}
  16.             {% endif %}
  17.             {% set checkCountriesFormatPattern = checkCountriesFormatPattern|merge({(country.id): country.checkVatIdPattern}) %}
  18.             {% set checkCountryIsoCodes = checkCountryIsoCodes|merge({(country.iso): country.checkVatIdPattern}) %}
  19.             {% set countryIdsIsoCodes = countryIdsIsoCodes|merge({(country.iso): country.id}) %}
  20.         {% endif %}
  21.     {% endfor %}
  22.     {% set taxPluginOptions = {
  23.         token: sw_csrf('frontend.acris-tax.vat-id-validation', {"mode": "token"}),
  24.         postUrl: path('frontend.acris-tax.vat-id-validation'),
  25.         defaultCountriesEU: defaultCountriesEU,
  26.         countryVatIdPatterns: countriesVatIdPattern,
  27.         countryIdsWithPattern: countriesVatIdPatternWithCountryIds,
  28.         checkCountriesVatIdPattern: checkCountriesVatIdPattern,
  29.         checkCountriesFormatPattern: checkCountriesFormatPattern,
  30.         checkCountryIsoCodes: checkCountryIsoCodes,
  31.         countryIdsIsoCodes: countryIdsIsoCodes,
  32.         validateFormat: config("AcrisTaxCS.config").validateVatIDFormatAllEUCountries,
  33.         validateApiService: config("AcrisTaxCS.config").VatIDAPIValidationAllEUCountries,
  34.         assignCategory: config("AcrisTaxCS.config").fillInCountryAutomatically,
  35.         entry: 'register'
  36.     } %}
  37.     <div class="acris-tax-vat-id-validation" data-acris-tax="true" data-acris-tax-validation="true" data-acris-tax-validation-options="{{ taxPluginOptions|json_encode }}">
  38.         {{ parent() }}
  39.     </div>
  40. {% endblock %}