src/Storefront/Resources/views/storefront/component/address/address-personal-company.html.twig line 1

  1. {% block component_account_register_company_fields %}
  2.     {% set accountTypeRequired = config('core.loginRegistration.showAccountTypeSelection') %}
  3.     {% if accountTypeRequired or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
  4.         <div class="{% if hasSelectedBusiness %}address-contact-type-company{% elseif prefix == "address" %}js-field-toggle-contact-type-company d-block{% else %}js-field-toggle-contact-type-company{% if customToggleTarget %}-{{ prefix }}{% endif %} d-none{% endif %}">
  5.             {% block component_address_form_company_fields %}
  6.                 <div class="row g-2">
  7.                     {% block component_address_form_company_name %}
  8.                         <div class="form-group col-12">
  9.                             {% if formViolations.getViolations("/company") is not empty %}
  10.                                 {% set violationPath = "/company" %}
  11.                             {% elseif formViolations.getViolations("/#{prefix}/company") is not empty %}
  12.                                 {% set violationPath = "/#{prefix}/company" %}
  13.                             {% else %}
  14.                                 {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.companyNameLabel"|trans|sw_sanitize }) %}
  15.                             {% endif %}
  16.                             {% block component_address_form_company_name_label %}
  17.                                 <label class="form-label"
  18.                                        for="{{ idPrefix ~ prefix }}company">
  19.                                     {{ "address.companyNameLabel"|trans|sw_sanitize }}{% if accountTypeRequired %}{{ "general.required"|trans|sw_sanitize }}{% endif %}
  20.                                 </label>
  21.                             {% endblock %}
  22.                             {% block component_address_form_company_name_input %}
  23.                                 <input type="text"
  24.                                        class="form-control{% if violationPath %} is-invalid{% endif %}"
  25.                                        id="{{ idPrefix ~ prefix }}company"
  26.                                        placeholder="{{ "address.companyNamePlaceholder"|trans|striptags }}"
  27.                                        name="{{ prefix }}[company]"
  28.                                        value="{{ address.get('company') }}"
  29.                                        data-form-validation-required
  30.                                        {% if requiredMessage is defined and accountTypeRequired %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
  31.                                        {% if accountTypeRequired %}required="required"{% endif %}>
  32.                             {% endblock %}
  33.                             {% block component_address_form_company_name_input_error %}
  34.                                 {% if violationPath %}
  35.                                     {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  36.                                 {% endif %}
  37.                             {% endblock %}
  38.                         </div>
  39.                     {% endblock %}
  40.                 </div>
  41.                 <div class="row g-2">
  42.                     {% block component_address_form_company_department %}
  43.                         <div class="form-group col-md-6">
  44.                             {% if formViolations.getViolations("/department") is not empty %}
  45.                                 {% set violationPath = "/department" %}
  46.                             {% elseif formViolations.getViolations("/#{prefix}/department") is not empty %}
  47.                                 {% set violationPath = "/#{prefix}/department" %}
  48.                             {% endif %}
  49.                             {% block component_address_form_company_department_label %}
  50.                                 <label class="form-label"
  51.                                        for="{{ idPrefix ~ prefix }}department">
  52.                                     {{ "address.companyDepartmentLabel"|trans|sw_sanitize }}
  53.                                 </label>
  54.                             {% endblock %}
  55.                             {% block component_address_form_company_department_input %}
  56.                                 <input type="text"
  57.                                        class="form-control{% if violationPath %} is-invalid{% endif %}"
  58.                                        id="{{ idPrefix ~ prefix }}department"
  59.                                        placeholder="{{ "address.companyDepartmentPlaceholder"|trans|striptags }}"
  60.                                        name="{{ prefix }}[department]"
  61.                                        value="{{ address.get('department') }}">
  62.                             {% endblock %}
  63.                             {% block component_address_form_company_department_input_error %}
  64.                                 {% if violationPath %}
  65.                                     {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  66.                                 {% endif %}
  67.                             {% endblock %}
  68.                         </div>
  69.                     {% endblock %}
  70.                     {% block component_address_form_company_vatId %}
  71.                         {% if prefix != 'shippingAddress' %}
  72.                             <div class="form-group col-md-6">
  73.                                 {% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
  74.                                     'vatIds': data.get('vatIds')
  75.                                 } %}
  76.                             </div>
  77.                         {% endif %}
  78.                     {% endblock %}
  79.                 </div>
  80.             {% endblock %}
  81.         </div>
  82.     {% endif %}
  83. {% endblock %}