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