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

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/address/address-form.html.twig' %}
  2. {% block component_address_form %}
  3.     {% block component_address_form_addressId %}
  4.         {{parent()}}
  5.     {% endblock %}
  6.     {# @deprecated tag:v6.5.0 - will be removed #}
  7.     {% if not feature('FEATURE_NEXT_15957') %}
  8.         {% set showVatIdField = false %}
  9.     {% endif %}
  10.     {% block component_address_form_company %}
  11.         {% if showFormCompany %}
  12.             {% if config('core.loginRegistration.showAccountTypeSelection') %}
  13.                 {% set accountTypeRequired = true %}
  14.             {% endif %}
  15.             {% if config('core.loginRegistration.showAccountTypeSelection') or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
  16.                 <div class="{% if prefix == "shippingAddress" or hasSelectedBusiness %}address-contact-type-company{% elseif prefix == "address" %}js-field-toggle-contact-type-company d-block{% else %}js-field-toggle-contact-type-company d-none{% endif %}">
  17.                     {% block component_address_form_company_fields %}
  18.                         <div class="{{ formRowClass }}">
  19.                             {% block component_address_form_company_name %}
  20.                                 <div class="form-group col-12">
  21.                                     {% if formViolations.getViolations("/company") is not empty %}
  22.                                         {% set violationPath = "/company" %}
  23.                                     {% elseif formViolations.getViolations("/#{prefix}/company") is not empty %}
  24.                                         {% set violationPath = "/#{prefix}/company" %}
  25.                                     {% endif %}
  26.                                     {% block component_address_form_company_name_label %}
  27.                                         {{parent()}}
  28.                                     {% endblock %}
  29.                                     {% block component_address_form_company_name_input %}
  30.                                         {{parent()}}
  31.                                     {% endblock %}
  32.                                     {% block component_address_form_company_name_input_error %}
  33.                                         {{parent()}}
  34.                                     {% endblock %}
  35.                                 </div>
  36.                             {% endblock %}
  37.                             {% block component_address_form_company_department %}
  38.                                 <div class="form-group col-md-12">
  39.                                     {% if formViolations.getViolations("/department") is not empty %}
  40.                                         {% set violationPath = "/department" %}
  41.                                     {% elseif formViolations.getViolations("/#{prefix}/department") is not empty %}
  42.                                         {% set violationPath = "/#{prefix}/department" %}
  43.                                     {% endif %}
  44.                                     {% block component_address_form_company_department_label %}
  45.                                         {{parent()}}
  46.                                     {% endblock %}
  47.                                     {% block component_address_form_company_department_input %}
  48.                                         {{parent()}}
  49.                                     {% endblock %}
  50.                                     {% block component_address_form_company_department_input_error %}
  51.                                         {{parent()}}
  52.                                     {% endblock %}
  53.                                 </div>
  54.                             {% endblock %}
  55.                             {% block component_address_form_company_vatId %}
  56.                                 {% if not feature('FEATURE_NEXT_15957') and showVatIdField %}
  57.                                     <div class="form-group col-md-12">
  58.                                         {% if formViolations.getViolations("/vatId") is not empty %}
  59.                                             {% set violationPath = "/vatId" %}
  60.                                         {% elseif formViolations.getViolations("/#{prefix}/vatId") is not empty %}
  61.                                             {% set violationPath = "/#{prefix}/vatId" %}
  62.                                         {% endif %}
  63.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  64.                                         {% block component_address_form_company_vatId_label %}
  65.                                             {{parent()}}
  66.                                         {% endblock %}
  67.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  68.                                         {% block component_address_form_company_vatId_input %}
  69.                                             {{parent()}}
  70.                                         {% endblock %}
  71.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  72.                                         {% block component_address_form_company_vatId_input_error %}
  73.                                             {% if violationPath %}
  74.                                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  75.                                             {% endif %}
  76.                                         {% endblock %}
  77.                                     </div>
  78.                                 {% elseif feature('FEATURE_NEXT_15957') and prefix == 'address' and showVatIdField %}
  79.                                     <div class="form-group col-md-6">
  80.                                         {% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
  81.                                             'vatIds': context.customer.vatIds
  82.                                         } %}
  83.                                     </div>
  84.                                 {% endif %}
  85.                             {% endblock %}
  86.                         </div>
  87.                     {% endblock %}
  88.                 </div>
  89.             {% endif %}
  90.         {% endif %}
  91.     {% endblock %}
  92.     {% block component_address_form_address_fields %}
  93.         <div class="{{ formRowClass }}">
  94.             {% block component_address_form_street %}
  95.                 <div class="form-group col-md-12">
  96.                     {% if formViolations.getViolations("/street") is not empty %}
  97.                         {% set violationPath = "/street" %}
  98.                     {% elseif formViolations.getViolations("/#{prefix}/street") is not empty %}
  99.                         {% set violationPath = "/#{prefix}/street" %}
  100.                     {% else %}
  101.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.streetLabel"|trans|sw_sanitize }) %}
  102.                     {% endif %}
  103.                     {% block component_address_form_street_label %}
  104.                         {{parent()}}
  105.                     {% endblock %}
  106.                     {% block component_address_form_street_input %}
  107.                         {{parent()}}
  108.                     {% endblock %}
  109.                     {% block component_address_form_street_input_error %}
  110.                         {{parent()}}
  111.                     {% endblock %}
  112.                 </div>
  113.             {% endblock %}
  114.             {% block component_address_form_zipcode_city %}
  115.                 {% set zipcodeField %}
  116.                 {% set zipcodeValue = formViolations.getInputData()['zipcode'] ?? data.get('zipcode') %}
  117.                     {% if formViolations.getViolations("/zipcode") is not empty %}
  118.                         {% set violationPath = "/zipcode" %}
  119.                     {% elseif formViolations.getViolations("/#{prefix}/zipcode") is not empty %}
  120.                         {% set violationPath = "/#{prefix}/zipcode" %}
  121.                     {% else %}
  122.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.zipcodeLabel"|trans|sw_sanitize }) %}
  123.                     {% endif %}
  124.                     {% block component_address_form_zipcode_label %}
  125.                         {{parent()}}
  126.                     {% endblock %}
  127.                     {% block component_address_form_zipcode_input %}
  128.                         {{parent()}}
  129.                     {% endblock %}
  130.                     {% block component_address_form_zipcode_error %}
  131.                         {{parent()}}
  132.                     {% endblock %}
  133.                 {% endset %}
  134.                 {% set cityField %}
  135.                     {% if formViolations.getViolations("/city") is not empty %}
  136.                         {% set violationPath = "/city" %}
  137.                     {% elseif formViolations.getViolations("/#{prefix}/city") is not empty %}
  138.                         {% set violationPath = "/#{prefix}/city" %}
  139.                     {% else %}
  140.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.cityLabel"|trans|sw_sanitize }) %}
  141.                         {% set violationPath = null %}
  142.                     {% endif %}
  143.                     {% block component_address_form_city_label %}
  144.                         {{parent()}}
  145.                     {% endblock %}
  146.                     {% block component_address_form_city_input %}
  147.                         {{parent()}}
  148.                     {% endblock %}
  149.                     {% block component_address_form_city_error %}
  150.                         {{parent()}}
  151.                     {% endblock %}
  152.                 {% endset %}
  153.                 {% if config('core.address.showZipcodeInFrontOfCity') %}
  154.                     <div class="form-group col-md-6 col-6">
  155.                         {{ zipcodeField }}
  156.                     </div>
  157.                     <div class="form-group col-md-6 col-6">
  158.                         {{ cityField }}
  159.                     </div>
  160.                 {% else %}
  161.                     <div class="form-group col-md-6 col-6">
  162.                         {{ cityField }}
  163.                     </div>
  164.                     <div class="form-group col-md-6 col-6">
  165.                         {{ zipcodeField }}
  166.                     </div>
  167.                 {% endif %}
  168.             {% endblock %}
  169.             {% block component_address_form_additional_field1 %}
  170.                 {% if config('core.loginRegistration.showAdditionalAddressField1') %}
  171.                     {% if formViolations.getViolations("/additionalAddressLine1") is not empty %}
  172.                         {% set violationPath = "/additionalAddressLine1" %}
  173.                     {% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine1") is not empty %}
  174.                         {% set violationPath = "/#{prefix}/additionalAddressLine1" %}
  175.                     {% endif %}
  176.                     <div class="form-group col-md-12">
  177.                         {% block component_address_form_additional_field1_label %}
  178.                            {{parent()}}
  179.                         {% endblock %}
  180.                         {% block component_address_form_additional_field1_input %}
  181.                             {{parent()}}
  182.                         {% endblock %}
  183.                         {% block component_address_form_additional_field1_error %}
  184.                             {{parent()}}
  185.                         {% endblock %}
  186.                     </div>
  187.                 {% endif %}
  188.             {% endblock %}
  189.             {% block component_address_form_additional_field2 %}
  190.                 {% if config('core.loginRegistration.showAdditionalAddressField2') %}
  191.                     {% if formViolations.getViolations("/additionalAddressLine2") is not empty %}
  192.                         {% set violationPath = "/additionalAddressLine2" %}
  193.                     {% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine2") is not empty %}
  194.                         {% set violationPath = "/#{prefix}/additionalAddressLine2" %}
  195.                     {% endif %}
  196.                     <div class="form-group col-md-12">
  197.                         {% block component_address_form_additional_field2_label %}
  198.                             {{parent()}}
  199.                         {% endblock %}
  200.                         {% block component_address_form_additional_field2_input %}
  201.                             {{parent()}}
  202.                         {% endblock %}
  203.                         {% block component_address_form_additional_field2_error %}
  204.                             {% if violationPath %}
  205.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  206.                             {% endif %}
  207.                         {% endblock %}
  208.                     </div>
  209.                 {% endif %}
  210.             {% endblock %}
  211.         </div>
  212.         <div class="{{ formRowClass }} country-and-state-form-elements" data-country-state-select="true">
  213.             {% block component_address_form_country %}
  214.                 <div class="form-group col-md-12">
  215.                     {% set initialCountryId = null %}
  216.                     {% if data.get('countryId') %}
  217.                         {% set initialCountryId = data.get('countryId') %}
  218.                     {% elseif page.countries|length == 1 %}
  219.                         {% set initialCountryId = (page.countries|first).id %}
  220.                     {% endif %}
  221.                     {% if formViolations.getViolations("/countryId") is not empty %}
  222.                         {% set violationPath = "/countryId" %}
  223.                     {% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
  224.                         {% set violationPath = "/#{prefix}/countryId" %}
  225.                     {% endif %}
  226.                     {% block component_address_form_country_label %}
  227.                         {{parent()}}
  228.                     {% endblock %}
  229.                     {% block component_address_form_country_select %}
  230.                         {{parent()}}
  231.                     {% endblock %}
  232.                 </div>
  233.                 <div class="form-group col-md-12  d-none">
  234.                     {% if formViolations.getViolations("/countryStateId") is not empty %}
  235.                         {% set violationPath = "/countryStateId" %}
  236.                     {% elseif formViolations.getViolations("/#{prefix}/countryStateId") is not empty %}
  237.                         {% set violationPath = "/#{prefix}/countryStateId" %}
  238.                     {% endif %}
  239.                     {% block component_address_form_country_state_label %}
  240.                         {{parent()}}
  241.                     {% endblock %}
  242.                     {% block component_address_form_country_state_select %}
  243.                         {{parent()}}
  244.                     {% endblock %}
  245.                     {% block component_address_form_country_error %}
  246.                         {{parent()}}
  247.                     {% endblock %}
  248.                 </div>
  249.             {% endblock %}
  250.         </div>
  251.         <div class="{{ formRowClass }}">
  252.             {% block component_address_form_phone_number %}
  253.                 {% if config('core.loginRegistration.showPhoneNumberField') %}
  254.                     <div class="form-group col-md-12">
  255.                         {% if formViolations.getViolations("/phoneNumber") is not empty %}
  256.                             {% set violationPath = "/phoneNumber" %}
  257.                         {% elseif formViolations.getViolations("/#{prefix}/phoneNumber") is not empty %}
  258.                             {% set violationPath = "/#{prefix}/phoneNumber" %}
  259.                         {% endif %}
  260.                         {% block component_address_form_phone_number_label %}
  261.                             {{parent()}}
  262.                         {% endblock %}
  263.                         {% block component_address_form_phone_number_input %}
  264.                             {{parent()}}
  265.                         {% endblock %}
  266.                         {% block component_address_form_phone_error %}
  267.                             {{parent()}}
  268.                         {% endblock %}
  269.                     </div>
  270.                 {% endif %}
  271.             {% endblock %}
  272.         </div>
  273.     {% endblock %}
  274. {% endblock %}