{% sw_extends '@Storefront/storefront/component/address/address-form.html.twig' %}
{% block component_address_form %}
{% block component_address_form_addressId %}
{% if data.get('id') %}
<input type="hidden"
name="{{ prefix }}[id]"
value="{{ data.get('id') }}">
{% endif %}
{% endblock %}
{# @deprecated tag:v6.5.0 - will be removed #}
{% if not feature('FEATURE_NEXT_15957') %}
{% set showVatIdField = false %}
{% endif %}
{% block component_address_form_company %}
{% if showFormCompany %}
{% if config('core.loginRegistration.showAccountTypeSelection') %}
{% set accountTypeRequired = true %}
{% endif %}
{% if config('core.loginRegistration.showAccountTypeSelection') or prefix == "address" or prefix == "shippingAddress" or hasSelectedBusiness %}
<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 %}">
{% block component_address_form_company_fields %}
<div class="{{ formRowClass }}">
{% block component_address_form_company_name %}
<div class="form-group col-6">
{% if formViolations.getViolations("/company") is not empty %}
{% set violationPath = "/company" %}
{% elseif formViolations.getViolations("/#{prefix}/company") is not empty %}
{% set violationPath = "/#{prefix}/company" %}
{% endif %}
{% block component_address_form_company_name_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}company">
{{ "address.companyNameLabel"|trans|sw_sanitize }}{% if prefix != "shippingAddress" and accountTypeRequired %}{{ "general.required"|trans|sw_sanitize }}{% endif %}
</label>
{% endblock %}
{% block component_address_form_company_name_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %} foobar"
id="{{ idPrefix ~ prefix }}company"
placeholder="{{ "address.companyNamePlaceholder"|trans|striptags }}"
name="{{ prefix }}[company]"
value="{{ data.get('company') }}"
required="required"
oninvalid="this.setCustomValidity('Bitte füllen Sie dieses Feld aus.')" oninput="this.setCustomValidity('')">
{% endblock %}
{% block component_address_form_company_name_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block component_address_form_company_department %}
<div class="form-group col-md-6">
{% if formViolations.getViolations("/department") is not empty %}
{% set violationPath = "/department" %}
{% elseif formViolations.getViolations("/#{prefix}/department") is not empty %}
{% set violationPath = "/#{prefix}/department" %}
{% endif %}
{% block component_address_form_company_department_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}department">
{{ "address.companyDepartmentLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_company_department_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}department"
placeholder="{{ "address.companyDepartmentPlaceholder"|trans|striptags }}"
name="{{ prefix }}[department]"
value="{{ data.get('department') }}">
{% endblock %}
{% block component_address_form_company_department_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block component_address_form_company_vatId %}
{% if not feature('FEATURE_NEXT_15957') and showVatIdField %}
<div class="form-group col-md-6">
{% if formViolations.getViolations("/vatId") is not empty %}
{% set violationPath = "/vatId" %}
{% elseif formViolations.getViolations("/#{prefix}/vatId") is not empty %}
{% set violationPath = "/#{prefix}/vatId" %}
{% endif %}
{# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
{% block component_address_form_company_vatId_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}vatId">
{{ "address.companyVatLabel"|trans|sw_sanitize }}
</label>
{% endblock %}
{# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
{% block component_address_form_company_vatId_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}vatId"
placeholder="{{ "address.companyVatPlaceholder"|trans|striptags }}"
name="{{ prefix }}[vatId]"
value="{{ data.get('vatId') }}">
{% endblock %}
{# @deprecated tag:v6.5.0 - will be removed, look into `@Storefront/storefront/component/address/address-personal-vat-id.html.twig` instead #}
{% block component_address_form_company_vatId_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% elseif feature('FEATURE_NEXT_15957') and prefix == 'address' and showVatIdField %}
<div class="form-group col-md-6">
{% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
'vatIds': context.customer.vatIds
} %}
</div>
{% endif %}
{% endblock %}
</div>
{% endblock %}
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block component_address_form_address_fields %}
<div class="{{ formRowClass }}">
{% block component_address_form_street %}
<div class="form-group col-md-6">
{% if formViolations.getViolations("/street") is not empty %}
{% set violationPath = "/street" %}
{% elseif formViolations.getViolations("/#{prefix}/street") is not empty %}
{% set violationPath = "/#{prefix}/street" %}
{% else %}
{% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.streetLabel"|trans|sw_sanitize }) %}
{% endif %}
{% block component_address_form_street_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressStreet">
{{ "address.streetLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_street_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressStreet"
placeholder="{{ "address.streetPlaceholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_street]"
value="{{ data.get('customFields')['custom_adress_street'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[street]"
value="{{ data.get('street') }}"
{% endif %}
data-form-validation-required
{% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
required="required" oninvalid="this.setCustomValidity('Bitte füllen Sie dieses Feld aus.')" oninput="this.setCustomValidity('')">
{% endblock %}
{% block component_address_form_street_input_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block component_address_form_additional_field1 %}
{% if config('core.loginRegistration.showAdditionalAddressField1') %}
{% if formViolations.getViolations("/additionalAddressLine1") is not empty %}
{% set violationPath = "/additionalAddressLine1" %}
{% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine1") is not empty %}
{% set violationPath = "/#{prefix}/additionalAddressLine1" %}
{% endif %}
<div class="form-group col-md-6">
{% block component_address_form_additional_field1_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AdditionalField1">
{{ "address.additionalField1Label"|trans|sw_sanitize }}{{ config('core.loginRegistration.additionalAddressField1Required') ? "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_additional_field1_input %}
<input type="text"
class="form-control {% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AdditionalField1"
placeholder="{{ "address.additionalField1Placeholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_additionalAddressLine1]"
value="{{ data.get('customFields')['custom_adress_additionalAddressLine1'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[additionalAddressLine1]"
value="{{ data.get('additionalAddressLine1') }}"
{% endif %}
{{ config('core.loginRegistration.additionalAddressField1Required') ? 'required="true"' }}>
{% endblock %}
{% block component_address_form_additional_field1_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% block component_address_form_zipcode_city %}
{% set zipcodeField %}
{% set zipcodeValue = formViolations.getInputData()['zipcode'] ?? data.get('zipcode') %}
{% if formViolations.getViolations("/zipcode") is not empty %}
{% set violationPath = "/zipcode" %}
{% elseif formViolations.getViolations("/#{prefix}/zipcode") is not empty %}
{% set violationPath = "/#{prefix}/zipcode" %}
{% else %}
{% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.zipcodeLabel"|trans|sw_sanitize }) %}
{% endif %}
{% block component_address_form_zipcode_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressZipcode">
{{ "address.zipcodeLabel"|trans|sw_sanitize }}<span {% if feature('v6.5.0.0') %}class="d-none"{% endif %} id="zipcodeLabel">{{ "general.required"|trans|sw_sanitize }}</span>
</label>
{% endblock %}
{% block component_address_form_zipcode_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressZipcode"
placeholder="{{ "address.zipcodePlaceholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_plz]"
value="{{ data.get('customFields')['custom_adress_plz'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[zipcode]"
value="{{ zipcodeValue }}"
{% endif %}
data-input-name="zipcodeInput"
{% if not feature('v6.5.0.0') %}required="required" oninvalid="this.setCustomValidity('Bitte füllen Sie dieses Feld aus.')" oninput="this.setCustomValidity('')"{% endif %}
>
{% endblock %}
{% block component_address_form_zipcode_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
{% endset %}
{% set cityField %}
{% if formViolations.getViolations("/city") is not empty %}
{% set violationPath = "/city" %}
{% elseif formViolations.getViolations("/#{prefix}/city") is not empty %}
{% set violationPath = "/#{prefix}/city" %}
{% else %}
{% set requiredMessage = "error.VIOLATION::IS_BLANK_ERROR"|trans({ '%field%': "address.cityLabel"|trans|sw_sanitize }) %}
{% set violationPath = null %}
{% endif %}
{% block component_address_form_city_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressCity">
{{ "address.cityLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_city_input %}
<input type="text"
class="form-control{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressCity"
placeholder="{{ "address.cityPlaceholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_city]"
value="{{ data.get('customFields')['custom_adress_city'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[city]"
value="{{ data.get('city') }}"
{% endif %}
data-form-validation-required
{% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}
required="required"
oninvalid="this.setCustomValidity('Bitte füllen Sie dieses Feld aus.')" oninput="this.setCustomValidity('')"
>
{% endblock %}
{% block component_address_form_city_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
{% endset %}
{% if config('core.address.showZipcodeInFrontOfCity') %}
<div class="form-group col-md-2 col-4">
{{ zipcodeField }}
</div>
<div class="form-group col-md-4 col-8">
{{ cityField }}
</div>
{% else %}
<div class="form-group col-md-4 col-8">
{{ cityField }}
</div>
<div class="form-group col-md-2 col-4">
{{ zipcodeField }}
</div>
{% endif %}
{% endblock %}
{% block component_address_form_country %}
<div class="form-group col-md-6">
{% set initialCountryId = null %}
{% if data.get('countryId') %}
{% set initialCountryId = data.get('countryId') %}
{% elseif page.countries|length == 1 %}
{% set initialCountryId = (page.countries|first).id %}
{% endif %}
{% if isCustomInput %}
{% set initialCountryId = data.get('customFields')['custom_adress_countryId'] %}
{% endif %}
{% if formViolations.getViolations("/countryId") is not empty %}
{% set violationPath = "/countryId" %}
{% elseif formViolations.getViolations("/#{prefix}/countryId") is not empty %}
{% set violationPath = "/#{prefix}/countryId" %}
{% endif %}
{% block component_address_form_country_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressCountry">
{{ "address.countryLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_country_select %}
{% set countrySelectionJsClass = isCustomInput ? 'js-custom-country-select' : 'js-country-select' %}
<select class="{{ countrySelectionJsClass }} country-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AddressCountry"
{# name="{{ prefix }}[countryId]" #}
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_countryId]"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[countryId]"
{% endif %}
required="required"
oninvalid="this.setCustomValidity('Bitte wählen Sie einen Eintrag in der Liste.')" oninput="this.setCustomValidity('')"
data-initial-country-id="{{ initialCountryId }}">
{% if not initialCountryId %}
<option disabled="disabled"
value=""
selected="selected">
{{ "address.countryPlaceholder"|trans|sw_sanitize }}
</option>
{% endif %}
{% for country in page.countries %}
<option {% if country.id == initialCountryId %}
selected="selected"
{% endif %}
{% if isCustomInput %}
value="{{ country.id }}"
data-vat-id-required="{{ country.vatIdRequired }}"
data-custom-vat-id-required="{{ country.vatIdRequired }}"
{% else %}
value="{{ country.id }}"
data-vat-id-required="{{ country.vatIdRequired }}"
data-custom-vat-id-required="0"
{% endif %}
{# data-vat-id-required="{{ country.vatIdRequired }}" #}
data-state-required="false"
{# data-state-required="{{ country.forceStateInRegistration }}" #}>
{% if feature('FEATURE_NEXT_15707') and not country.shippingAvailable and disableNonShippableCountries %}
disabled="disabled"
{% endif %}
{{ country.translated.name }}{% if feature('FEATURE_NEXT_15707') and showNoShippingPostfix and not country.shippingAvailable %} {{ "address.countryPostfixNoShipping"|trans|sw_sanitize }}{% endif %}
</option>
{% endfor %}
</select>
{% endblock %}
</div>
<div class="form-group col-md-6 d-none country-state-select-container">
{% if formViolations.getViolations("/countryStateId") is not empty %}
{% set violationPath = "/countryStateId" %}
{% elseif formViolations.getViolations("/#{prefix}/countryStateId") is not empty %}
{% set violationPath = "/#{prefix}/countryStateId" %}
{% endif %}
{% block component_address_form_country_state_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressCountryState">
{{ "address.countryStateLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_country_state_select %}
<select class="country-state-select {{ formSelectClass }}{% if violationPath %} is-invalid{% endif %} js-country-state-select"
id="{{ idPrefix ~ prefix }}AddressCountryState"
name="{{ prefix }}[countryStateId]"
data-initial-country-state-id="{{ data.get('countryStateId') }}">
<option value=""
selected="selected"
data-placeholder-option="true">
{{ "address.countryStatePlaceholder"|trans|sw_sanitize }}
</option>
</select>
{% endblock %}
{% block component_address_form_country_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block component_address_form_additional_field2 %}
{% if config('core.loginRegistration.showAdditionalAddressField2') %}
{% if formViolations.getViolations("/additionalAddressLine2") is not empty %}
{% set violationPath = "/additionalAddressLine2" %}
{% elseif formViolations.getViolations("/#{prefix}/additionalAddressLine2") is not empty %}
{% set violationPath = "/#{prefix}/additionalAddressLine2" %}
{% endif %}
<div class="form-group col-md-6">
{% block component_address_form_additional_field2_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AdditionalField2">
{{ "address.additionalField2Label"|trans|sw_sanitize }}{{ config('core.loginRegistration.additionalAddressField2Required') ? "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_additional_field2_input %}
<input type="text"
class="form-control {% if violationPath %} is-invalid{% endif %}"
id="{{ idPrefix ~ prefix }}AdditionalField2"
placeholder="{{ "address.additionalField2Placeholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[custom_additionalAddressLine2]"
value="{{ data.get('custom_additionalAddressLine2') }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[additionalAddressLine2]"
value="{{ data.get('additionalAddressLine2') }}"
{% endif %}
{{ config('core.loginRegistration.additionalAddressField2Required') ? 'required="true"' }}>
{% endblock %}
{% block component_address_form_additional_field2_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
</div>
{# <div class="{{ formRowClass }} country-and-state-form-elements" data-country-state-select="true">
</div> #}
<div class="{{ formRowClass }}">
{% block component_address_form_phone_number %}
{% if config('core.loginRegistration.showPhoneNumberField') %}
<div class="form-group col-md-6">
{% if formViolations.getViolations("/phoneNumber") is not empty %}
{% set violationPath = "/phoneNumber" %}
{% elseif formViolations.getViolations("/#{prefix}/phoneNumber") is not empty %}
{% set violationPath = "/#{prefix}/phoneNumber" %}
{% endif %}
{% block component_address_form_phone_number_label %}
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressPhoneNumber">
{{ "address.phoneNumberLabel"|trans|sw_sanitize }}{{ config('core.loginRegistration.phoneNumberFieldRequired') ? "general.required"|trans|sw_sanitize }}
</label>
{% endblock %}
{% block component_address_form_phone_number_input %}
<input type="text"
class="form-control"
id="{{ idPrefix ~ prefix }}AddressPhoneNumber"
placeholder="{{ "address.phoneNumberPlaceholder"|trans|striptags }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_number]"
value="{{ data.get('customFields')['custom_adress_number'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[phoneNumber]"
value="{{ data.get('phoneNumber') }}"
{% endif %}
{{ config('core.loginRegistration.phoneNumberFieldRequired') ? 'required="true"' }}>
{% endblock %}
{% block component_address_form_phone_error %}
{% if violationPath %}
{% sw_include '@Storefront/storefront/utilities/form-violation.html.twig' %}
{% endif %}
{% endblock %}
</div>
<div class="form-group col-md-6">
<label class="form-label"
for="{{ idPrefix ~ prefix }}AddressMobilePhoneNumber">
{{ "address.mobilePhoneNumberLabel"|trans|sw_sanitize }}
</label>
<input type="text"
class="form-control"
id="{{ idPrefix ~ prefix }}AddressMobilePhoneNumber"
placeholder="{{ "address.mobilePhoneNumberPlaceholder"|trans|striptags }}"
{% if
(isCustomInput and prefix == "billingAddress") or
(isCustomInput and prefix == "address") or
(isCustomInput != true and prefix == "shippingAddress" ) or
(isCustomInput != true and prefix == "address" and idPrefix == "shipping-")
%}
name="{{ prefix }}[customFields][custom_adress_mobile_phone_billing]"
value="{{ data.get('customFields')['custom_adress_mobile_phone_billing'] }}"
data-form-custom-field-exists="true"
{% elseif (isCustomInput != true and prefix == "billingAddress") or (isCustomInput != true and prefix == "address") %}
name="{{ prefix }}[customFields][custom_adress_mobile_phone_registration]"
value="{{ data.get('customFields')['custom_adress_mobile_phone_registration'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[customFields][custom_adress_mobile_phone_registration]"
value="{{ data.get('customFields')['custom_adress_mobile_phone_registration'] }}"
data-form-custom-field-exists="true"
{% endif %}
>
</div>
{% endif %}
{% endblock %}
</div>
{% if hideEmailField != "hide" %}
<div class="form-group">
{% block component_address_form_email_label %}
{% if prefix == "shippingAddress" %}
<label class="form-label"
for="{{ prefix }}AddressEmail">
Versand-E-Mail-Adresse{{ "general.required"|trans|sw_sanitize }}
</label>
{% else %}
<label class="form-label"
for="{{ prefix }}AddressEmail">
{% if isCustomInput %}
{{ "account.address.customEmailFieldLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
{% else %}
{{ "account.address.abweichendeEmailfürRechnungLabel"|trans|sw_sanitize }}
{% endif %}
</label>
{% endif %}
{% endblock %}
{% block component_address_form_email_input %}
<input type="text"
class="form-control"
id="{{ prefix }}AddressEmail"
placeholder="{{ "account.personalMailPlaceholder"|trans|sw_sanitize }}"
{% if isCustomInput %}
name="{{ prefix }}[customFields][custom_adress_invoiceEmail]"
value="{{ data.get('customFields')['custom_adress_invoiceEmail'] }}"
data-form-custom-field-exists="true"
{% else %}
name="{{ prefix }}[AddressEmail]"
value="{{ data.get('customFields')['custom_adress_email'] }}"
{% endif %}
{% if isCustomInput || prefix == "shippingAddress" %}required="required" onblur="validateCustomEmail(this)" oninvalid="this.setCustomValidity('Bitte füllen Sie dieses Feld aus.')" oninput="this.setCustomValidity('')" {% endif %}
data-form-validation-required
{% if requiredMessage is defined %}data-form-validation-required-message="{{ requiredMessage }}"{% endif %}>
{% endblock %}
{% block component_address_form_email_input_error %}
{% endblock %}
</div>
{% endif %}
{% endblock %}
{% endblock %}