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

Open in your IDE?
  1. {% block component_address_form %}
  2.     {% block component_address_form_addressId %}
  3.         {% if data.get('id') %}
  4.             <input type="hidden"
  5.                    name="{{ prefix }}[id]"
  6.                    value="{{ data.get('id') }}">
  7.         {% endif %}
  8.     {% endblock %}
  9.     {# @deprecated tag:v6.5.0 - will be removed #}
  10.     {% if not feature('FEATURE_NEXT_15957') %}
  11.         {% set showVatIdField = false %}
  12.     {% endif %}
  13.     {% block component_address_form_company %}
  14.         {% if showFormCompany %}
  15.             {% if config('core.loginRegistration.showAccountTypeSelection') %}
  16.                 {% set accountTypeRequired = true %}
  17.             {% endif %}
  18.             {% if config('core.loginRegistration.showAccountTypeSelection') or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
  19.                 <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 %}">
  20.                     {% block component_address_form_company_fields %}
  21.                         <div class="{{ formRowClass }}">
  22.                             {% block component_address_form_company_name %}
  23.                                 <div class="form-group-text col-12 is-empty">
  24.                                     {% if formViolations.getViolations("/company") is not empty %}
  25.                                         {% set violationPath = "/company" %}
  26.                                     {% elseif formViolations.getViolations("/#{prefix}/company") is not empty %}
  27.                                         {% set violationPath = "/#{prefix}/company" %}
  28.                                     {% endif %}
  29.                                     {% block component_address_form_company_name_label %}
  30.                                         <label class="form-label"
  31.                                                for="{{ idPrefix ~ prefix }}company">
  32.                                             <span>{{ "address.companyNameLabel"|trans|sw_sanitize }}{% if prefix != "shippingAddress" and accountTypeRequired %}{{ "general.required"|trans|sw_sanitize }}{% endif %}</span>
  33.                                         </label>
  34.                                     {% endblock %}
  35.                                     {% block component_address_form_company_name_input %}
  36.                                         <input type="text"
  37.                                                class="form-control{% if violationPath %} is-invalid{% endif %}"
  38.                                                id="{{ idPrefix ~ prefix }}company"
  39.                                                {# placeholder="{{ "address.companyNamePlaceholder"|trans|striptags }}" #}
  40.                                                name="{{ prefix }}[company]"
  41.                                                value="{{ data.get('company') }}"
  42.                                                {% if prefix != "shippingAddress" and accountTypeRequired %}required="required"{% endif %}>
  43.                                     {% endblock %}
  44.                                     {% block component_address_form_company_name_input_error %}
  45.                                         {% if violationPath %}
  46.                                             {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  47.                                         {% endif %}
  48.                                     {% endblock %}
  49.                                 </div>
  50.                             {% endblock %}
  51.                             {% block component_address_form_company_department %}
  52.                                 <div hidden class="form-group col-md-6">
  53.                                     {% if formViolations.getViolations("/department") is not empty %}
  54.                                         {% set violationPath = "/department" %}
  55.                                     {% elseif formViolations.getViolations("/#{prefix}/department") is not empty %}
  56.                                         {% set violationPath = "/#{prefix}/department" %}
  57.                                     {% endif %}
  58.                                     {% block component_address_form_company_department_label %}
  59.                                         <label class="form-label"
  60.                                                for="{{ idPrefix ~ prefix }}department">
  61.                                             <span>{{ "address.companyDepartmentLabel"|trans|sw_sanitize }}</span>
  62.                                         </label>
  63.                                     {% endblock %}
  64.                                     {% block component_address_form_company_department_input %}
  65.                                         <input type="text"
  66.                                                class="form-control{% if violationPath %} is-invalid{% endif %}"
  67.                                                id="{{ idPrefix ~ prefix }}department"
  68.                                                placeholder="{{ "address.companyDepartmentPlaceholder"|trans|striptags }}"
  69.                                                name="{{ prefix }}[department]"
  70.                                                value="{{ data.get('department') }}">
  71.                                     {% endblock %}
  72.                                     {% block component_address_form_company_department_input_error %}
  73.                                         {% if violationPath %}
  74.                                             {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  75.                                         {% endif %}
  76.                                     {% endblock %}
  77.                                 </div>
  78.                             {% endblock %}
  79.                             {% block component_address_form_company_vatId %}
  80.                                 {% if not feature('FEATURE_NEXT_15957') and showVatIdField %}
  81.                                     <div class="form-group col-md-6">
  82.                                         {% if formViolations.getViolations("/vatId") is not empty %}
  83.                                             {% set violationPath = "/vatId" %}
  84.                                         {% elseif formViolations.getViolations("/#{prefix}/vatId") is not empty %}
  85.                                             {% set violationPath = "/#{prefix}/vatId" %}
  86.                                         {% endif %}
  87.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  88.                                         {% block component_address_form_company_vatId_label %}
  89.                                             <label class="form-label"
  90.                                                    for="{{ idPrefix ~ prefix }}vatId">
  91.                                                 <span>{{ "address.companyVatLabel"|trans|sw_sanitize }}</span>
  92.                                             </label>
  93.                                         {% endblock %}
  94.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  95.                                         {% block component_address_form_company_vatId_input %}
  96.                                             <input type="text"
  97.                                                    class="form-control{% if violationPath %} is-invalid{% endif %}"
  98.                                                    id="{{ idPrefix ~ prefix }}vatId"
  99.                                                    placeholder="{{ "address.companyVatPlaceholder"|trans|striptags }}"
  100.                                                    name="{{ prefix }}[vatId]"
  101.                                                    value="{{ data.get('vatId') }}">
  102.                                         {% endblock %}
  103.                                         {# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
  104.                                         {% block component_address_form_company_vatId_input_error %}
  105.                                             {% if violationPath %}
  106.                                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  107.                                             {% endif %}
  108.                                         {% endblock %}
  109.                                     </div>
  110.                                 {% elseif feature('FEATURE_NEXT_15957') and prefix == 'address' and showVatIdField %}
  111.                                     <div class="form-group col-md-6">
  112.                                         {% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
  113.                                             'vatIds': context.customer.vatIds
  114.                                         } %}
  115.                                     </div>
  116.                                 {% endif %}
  117.                             {% endblock %}
  118.                         </div>
  119.                     {% endblock %}
  120.                 </div>
  121.             {% endif %}
  122.         {% endif %}
  123.     {% endblock %}
  124.     {% block component_address_form_address_fields %}
  125.         <div class="row">
  126.             {% block component_address_form_street %}
  127.                     {% if formViolations.getViolations("/street") is not empty %}
  128.                         {% set violationPath = "/street" %}
  129.                     {% elseif formViolations.getViolations("/#{prefix}/street") is not empty %}
  130.                         {% set violationPath = "/#{prefix}/street" %}
  131.                     {% else %}
  132.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.streetLabel"|trans|sw_sanitize }) %}
  133.                     {% endif %}
  134.                     <div class="form-group-text is-empty col-md-12">
  135.                         {% block component_address_form_street_label %}
  136.                             <label class="form-label"
  137.                                 for="{{ idPrefix ~ prefix }}AddressStreet">
  138.                                 <span>{{ "address.streetLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}</span>
  139.                             </label>
  140.                         {% endblock %}
  141.                         {% block component_address_form_street_input %}
  142.                             <input type="text"
  143.                                 class="form-control{% if violationPath %} is-invalid{% endif %}"
  144.                                 id="{{ idPrefix ~ prefix }}AddressStreet"
  145.                                 {# placeholder="{{ "address.streetPlaceholder"|trans|striptags }}" #}
  146.                                 name="{{ prefix }}[street]"
  147.                                 value="{{ data.get('street') }}"
  148.                                 data-form-validation-required
  149.                                 {% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
  150.                                 required="required">
  151.                         {% endblock %}
  152.                         {% block component_address_form_street_input_error %}
  153.                             {% if violationPath %}
  154.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  155.                             {% endif %}
  156.                         {% endblock %}
  157.                     </div>
  158.             {% endblock %}
  159.             {% block component_address_form_zipcode_city %}
  160.                 {% set zipcodeField %}
  161.                     {% if formViolations.getViolations("/zipcode") is not empty %}
  162.                         {% set violationPath = "/zipcode" %}
  163.                     {% elseif formViolations.getViolations("/#{prefix}/zipcode") is not empty %}
  164.                         {% set violationPath = "/#{prefix}/zipcode" %}
  165.                     {% else %}
  166.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.zipcodeLabel"|trans|sw_sanitize }) %}
  167.                     {% endif %}
  168.                     <div class="form-group-text is-empty">
  169.                         {% block component_address_form_zipcode_label %}
  170.                             <label class="form-label"
  171.                                 for="{{ idPrefix ~ prefix }}AddressZipcode">
  172.                                 <span>{{ "address.zipcodeLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}</span>
  173.                             </label>
  174.                         {% endblock %}
  175.                         {% block component_address_form_zipcode_input %}
  176.                             <input type="text"
  177.                                 class="form-control{% if violationPath %} is-invalid{% endif %}"
  178.                                 id="{{ idPrefix ~ prefix }}AddressZipcode"
  179.                                 {# placeholder="{{ "address.zipcodePlaceholder"|trans|striptags }}" #}
  180.                                 name="{{ prefix }}[zipcode]"
  181.                                 value="{{ data.get('zipcode') }}"
  182.                                 data-form-validation-required
  183.                                 {% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
  184.                                 required="required">
  185.                         {% endblock %}
  186.                         {% block component_address_form_zipcode_error %}
  187.                             {% if violationPath %}
  188.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  189.                             {% endif %}
  190.                         {% endblock %}
  191.                     </div>
  192.                 {% endset %}
  193.                 {% set cityField %}
  194.                     {% if formViolations.getViolations("/city") is not empty %}
  195.                         {% set violationPath = "/city" %}
  196.                     {% elseif formViolations.getViolations("/#{prefix}/city") is not empty %}
  197.                         {% set violationPath = "/#{prefix}/city" %}
  198.                     {% else %}
  199.                         {% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.cityLabel"|trans|sw_sanitize }) %}
  200.                         {% set violationPath = null %}
  201.                     {% endif %}
  202.                     <div class="form-group-text is-empty">
  203.                         {% block component_address_form_city_label %}
  204.                             <label class="form-label"
  205.                                 for="{{ idPrefix ~ prefix }}AddressCity">
  206.                                 <span>{{ "address.cityLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}</span>
  207.                             </label>
  208.                         {% endblock %}
  209.                         {% block component_address_form_city_input %}
  210.                             <input type="text"
  211.                                 class="form-control{% if violationPath %} is-invalid{% endif %}"
  212.                                 id="{{ idPrefix ~ prefix }}AddressCity"
  213.                                 {# placeholder="{{ "address.cityPlaceholder"|trans|striptags }}" #}
  214.                                 name="{{ prefix }}[city]"
  215.                                 value="{{ data.get('city') }}"
  216.                                 data-form-validation-required
  217.                                 {% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
  218.                                 required="required">
  219.                         {% endblock %}
  220.                         {% block component_address_form_city_error %}
  221.                             {% if violationPath %}
  222.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  223.                             {% endif %}
  224.                         {% endblock %}
  225.                     </div>
  226.                 {% endset %}
  227.                 {% if config('core.address.showZipcodeInFrontOfCity') %}
  228.                     <div class="form-group col-md-4 col-12">
  229.                         {{ zipcodeField }}
  230.                     </div>
  231.                     <div class="form-group col-md-8 col-12">
  232.                         {{ cityField }}
  233.                     </div>
  234.                 {% else %}
  235.                     <div class="form-group col-md-8 col-12">
  236.                         {{ cityField }}
  237.                     </div>
  238.                     <div class="form-group col-md-4 col-12">
  239.                         {{ zipcodeField }}
  240.                     </div>
  241.                 {% endif %}
  242.             {% endblock %}
  243.             {% block component_address_form_additional_field1 %}
  244.                 {% if config('core.loginRegistration.showAdditionalAddressField1') %}
  245.                     {% if formViolations.getViolations("/additionalAddressLine1") is not empty %}
  246.                         {% set violationPath = "/additionalAddressLine1" %}
  247.                     {% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine1") is not empty %}
  248.                         {% set violationPath = "/#{prefix}/additionalAddressLine1" %}
  249.                     {% endif %}
  250.                     <div class="form-group col-md-6">
  251.                         {% block component_address_form_additional_field1_label %}
  252.                             <label class="form-label"
  253.                                    for="{{ idPrefix ~ prefix }}AdditionalField1">
  254.                                 <span>{{ "address.additionalField1Label"|trans|sw_sanitize }}{{ config('core.loginRegistration.additionalAddressField1Required') ? "general.required"|trans|sw_sanitize }}</span>
  255.                             </label>
  256.                         {% endblock %}
  257.                         {% block component_address_form_additional_field1_input %}
  258.                             <input type="text"
  259.                                    class="form-control {% if violationPath %} is-invalid{% endif %}"
  260.                                    id="{{ idPrefix ~ prefix }}AdditionalField1"
  261.                                    placeholder="{{ "address.additionalField1Placeholder"|trans|striptags }}"
  262.                                    name="{{ prefix }}[additionalAddressLine1]"
  263.                                    value="{{ data.get('additionalAddressLine1') }}"
  264.                                     {{ config('core.loginRegistration.additionalAddressField1Required') ? 'required="true"' }}>
  265.                         {% endblock %}
  266.                         {% block component_address_form_additional_field1_error %}
  267.                             {% if violationPath %}
  268.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  269.                             {% endif %}
  270.                         {% endblock %}
  271.                     </div>
  272.                 {% endif %}
  273.             {% endblock %}
  274.             {% block component_address_form_additional_field2 %}
  275.                 {% if config('core.loginRegistration.showAdditionalAddressField2') %}
  276.                     {% if formViolations.getViolations("/additionalAddressLine2") is not empty %}
  277.                         {% set violationPath = "/additionalAddressLine2" %}
  278.                     {% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine2") is not empty %}
  279.                         {% set violationPath = "/#{prefix}/additionalAddressLine2" %}
  280.                     {% endif %}
  281.                     <div class="form-group col-md-6">
  282.                         {% block component_address_form_additional_field2_label %}
  283.                             <label class="form-label"
  284.                                    for="{{ idPrefix ~ prefix }}AdditionalField2">
  285.                                 <span>{{ "address.additionalField2Label"|trans|sw_sanitize }}{{ config('core.loginRegistration.additionalAddressField2Required') ? "general.required"|trans|sw_sanitize }}</span>
  286.                             </label>
  287.                         {% endblock %}
  288.                         {% block component_address_form_additional_field2_input %}
  289.                             <input type="text"
  290.                                    class="form-control {% if violationPath %} is-invalid{% endif %}"
  291.                                    id="{{ idPrefix ~ prefix }}AdditionalField2"
  292.                                    placeholder="{{ "address.additionalField2Placeholder"|trans|striptags }}"
  293.                                    name="{{ prefix }}[additionalAddressLine2]"
  294.                                    value="{{ data.get('additionalAddressLine2') }}"
  295.                                     {{ config('core.loginRegistration.additionalAddressField2Required') ? 'required="true"' }}>
  296.                         {% endblock %}
  297.                         {% block component_address_form_additional_field2_error %}
  298.                             {% if violationPath %}
  299.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  300.                             {% endif %}
  301.                         {% endblock %}
  302.                     </div>
  303.                 {% endif %}
  304.             {% endblock %}
  305.         </div>
  306.         <div class="{{ formRowClass }} country-and-state-form-elements" data-country-state-select="true">
  307.             {% block component_address_form_country %}
  308.                 <div class="form-group col-md-12">
  309.                     {% set initialCountryId = null %}
  310.                     {% if data.get('countryId') %}
  311.                         {% set initialCountryId = data.get('countryId') %}
  312.                     {% elseif page.countries|length == 1 %}
  313.                         {% set initialCountryId = (page.countries|first).id %}
  314.                     {% endif %}
  315.                     {% if formViolations.getViolations("/countryId") is not empty %}
  316.                         {% set violationPath = "/countryId" %}
  317.                     {% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
  318.                         {% set violationPath = "/#{prefix}/countryId" %}
  319.                     {% endif %}
  320.                     {% block component_address_form_country_label %}
  321.                         <label class="form-label"
  322.                                for="{{ idPrefix ~ prefix }}AddressCountry">
  323.                             <span>{{ "address.countryLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}</span>
  324.                         </label>
  325.                     {% endblock %}
  326.                     {% block component_address_form_country_select %}
  327.                     <div class="custom-dropdown">
  328.                         <select class="country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
  329.                                 id="{{ idPrefix ~ prefix }}AddressCountry"
  330.                                 name="{{ prefix }}[countryId]"
  331.                                 required="required"
  332.                                 data-initial-country-id="{{ initialCountryId }}">
  333.                             {% if not initialCountryId %}
  334.                                 <option disabled="disabled"
  335.                                         value=""
  336.                                         selected="selected">
  337.                                     {{ "address.countryPlaceholder"|trans|sw_sanitize }}
  338.                                 </option>
  339.                             {% endif %}
  340.                             {% for country in page.countries %}
  341.                                 <option {% if country.id == initialCountryId %}
  342.                                         selected="selected"
  343.                                         {% endif %}
  344.                                         value="{{ country.id }}"
  345.                                         data-vat-id-required="{{ country.vatIdRequired }}"
  346.                                         data-state-required="{{ country.forceStateInRegistration }}"
  347.                                         {% if feature('FEATURE_NEXT_15707') and  not country.shippingAvailable and disableNonShippableCountries %}
  348.                                             disabled="disabled"
  349.                                         {% endif %}>
  350.                                     {{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
  351.                                 </option>
  352.                             {% endfor %}
  353.                         </select>
  354.                     </div>
  355.                     {% endblock %}
  356.                 </div>
  357.                 <div class="form-group col-md-6  d-none">
  358.                     {% if formViolations.getViolations("/countryStateId") is not empty %}
  359.                         {% set violationPath = "/countryStateId" %}
  360.                     {% elseif formViolations.getViolations("/#{prefix}/countryStateId") is not empty %}
  361.                         {% set violationPath = "/#{prefix}/countryStateId" %}
  362.                     {% endif %}
  363.                     {% block component_address_form_country_state_label %}
  364.                         <label class="form-label"
  365.                                for="{{ idPrefix ~ prefix }}AddressCountryState">
  366.                             <span>{{ "address.countryStateLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}</span>
  367.                         </label>
  368.                     {% endblock %}
  369.                     {% block component_address_form_country_state_select %}
  370.                     <div class="custom-dropdown">
  371.                         <select class="country-state-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
  372.                                 id="{{ idPrefix ~ prefix }}AddressCountryState"
  373.                                 name="{{ prefix }}[countryStateId]"
  374.                                 data-initial-country-state-id="{{ data.get('countryStateId') }}">
  375.                             <option value=""
  376.                                     selected="selected"
  377.                                     data-placeholder-option="true">
  378.                                 {{ "address.countryStatePlaceholder"|trans|sw_sanitize }}
  379.                             </option>
  380.                         </select>
  381.                     </div>
  382.                     {% endblock %}
  383.                     {% block component_address_form_country_error %}
  384.                         {% if violationPath %}
  385.                             {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  386.                         {% endif %}
  387.                     {% endblock %}
  388.                 </div>
  389.             {% endblock %}
  390.         </div>
  391.         <div class="{{ formRowClass }}">
  392.             {% block component_address_form_phone_number %}
  393.                 {% if config('core.loginRegistration.showPhoneNumberField') %}
  394.                     <div class="form-group-text is-empty col-md-12" style="margin-bottom:20px">
  395.                         {% if formViolations.getViolations("/phoneNumber") is not empty %}
  396.                             {% set violationPath = "/phoneNumber" %}
  397.                         {% elseif formViolations.getViolations("/#{prefix}/phoneNumber") is not empty %}
  398.                             {% set violationPath = "/#{prefix}/phoneNumber" %}
  399.                         {% endif %}
  400.                         {% block component_address_form_phone_number_label %}
  401.                             <label class="form-label"
  402.                                    for="{{ idPrefix ~ prefix }}AddressPhoneNumber">
  403.                                 <span>{{ "address.phoneNumberLabel"|trans|sw_sanitize }}{{ config('core.loginRegistration.phoneNumberFieldRequired') ? "general.required"|trans|sw_sanitize }}</span>
  404.                             </label>
  405.                         {% endblock %}
  406.                         {% block component_address_form_phone_number_input %}
  407.                             <input type="text"
  408.                                    class="form-control"
  409.                                    id="{{ idPrefix ~ prefix }}AddressPhoneNumber"
  410.                                    {# placeholder="{{ "address.phoneNumberPlaceholder"|trans|striptags }}" #}
  411.                                    name="{{ prefix }}[phoneNumber]"
  412.                                    value="{{ data.get('phoneNumber') }}"
  413.                                 {{ config('core.loginRegistration.phoneNumberFieldRequired') ? 'required="true"' }}>
  414.                         {% endblock %}
  415.                         {% block component_address_form_phone_error %}
  416.                             {% if violationPath %}
  417.                                 {% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
  418.                             {% endif %}
  419.                         {% endblock %}
  420.                     </div>
  421.                 {% endif %}
  422.             {% endblock %}
  423.         </div>
  424.     {% endblock %}
  425. {% endblock %}