vendor/shopware/storefront/Resources/views/storefront/component/address/address-personal-vat-id.html.twig line 1

Open in your IDE?
  1. {% block component_account_register_personal_vat_id_field %}
  2.     {% set vatIdValue = activeRoute == 'frontend.account.profile.page' or (feature('FEATURE_NEXT_15957') and activeRoute == 'frontend.account.addressbook' and context.customer.guest) ? vatIds[0] : vatIds.get(0) %}
  3.     {% set violationLabel = null %}
  4.     {% set violationPath = null %}
  5.     {% for violation in formViolations.getViolations("/vatIds") %}
  6.         {% set violationPath = "/vatIds" %}
  7.         {% set violationLabel = "address.companyVatLabel"|trans|sw_sanitize %}
  8.         {% if violation.code === 'VIOLATION::IS_BLANK_ERROR' %}
  9.             {% set vatIdValue = null %}
  10.         {% elseif formViolations.getInputData()['vatIds'][0] is defined %}
  11.             {% set vatIdValue = formViolations.getInputData()['vatIds'][0] %}
  12.         {% endif %}
  13.     {% endfor %}
  14.     {% block component_address_form_company_vatId_label %}
  15.         <label class="form-label"
  16.                for="vatIds">
  17.             {{ "address.companyVatLabel"|trans|sw_sanitize }}
  18.         </label>
  19.     {% endblock %}
  20.     {% block component_address_form_company_vatId_input %}
  21.         <input type="text"
  22.                class="form-control{% if violationPath %} is-invalid{% endif %}"
  23.                id="vatIds"
  24.                placeholder="{{ "address.companyVatPlaceholder"|trans|striptags }}"
  25.                name="vatIds[]"
  26.                value="{{ vatIdValue }}">
  27.     {% endblock %}
  28.     {% block component_address_form_company_vatId_input_error %}
  29.         {% if violationPath %}
  30.             {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  31.         {% endif %}
  32.     {% endblock %}
  33. {% endblock %}