custom/plugins/WynTheme/src/Resources/views/storefront/component/address/address-personal.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@Storefront/storefront/component/address/address-personal.html.twig' %}
  2. {% block component_address_personal_vat_id_fields %}
  3.   <div class="{{ formRowClass }}">
  4.     <div class="form-group col-12 form-required-container">
  5.       {% sw_include '@Storefront/storefront/component/address/address-personal-vat-id.html.twig' with {
  6.         'vatIds': data.get('vatIds'),
  7.         'editMode': true
  8.       } %}
  9.     </div>
  10.   </div>
  11. {% endblock %}
  12. {% block component_address_personal_fields_birthday_select_day %}
  13.   <div class="form-group col-md-2 col-4">
  14.     <wyn-select
  15.       id="{{ idPrefix ~ prefix }}personalBirthday"
  16.       name="{% if prefix %}{{ prefix }}[birthdayDay]{% else %}birthdayDay{% endif %}"
  17.       class="{% if formViolations.getViolations('/birthdayDay') is not empty %} is-invalid{% endif %}"
  18.       {{ config('core.loginRegistration.birthdayFieldRequired') ? 'required' }}
  19.     >
  20.       {% if not data.get('birthdayDay') %}
  21.         <wyn-option selected disabled value="">
  22.           {{ "account.personalBirthdaySelectDay"|trans|sw_sanitize }}
  23.         </wyn-option>
  24.       {% endif %}
  25.       {% for day in range(1, 31) %}
  26.         <wyn-option value="{{ day }}"
  27.           {% if day == data.get('birthdayDay') %} selected="selected"{% endif %}>
  28.           {{ day }}
  29.         </wyn-option>
  30.       {% endfor %}
  31.     </wyn-select>
  32.     {% block component_address_personal_fields_birthday_select_day_error %}
  33.       {{ parent() }}
  34.     {% endblock %}
  35.   </div>
  36. {% endblock %}
  37. {% block component_address_personal_fields_birthday_select_month %}
  38.   <div class="form-group col-md-2 col-4">
  39.     <wyn-select
  40.       name="{% if prefix %}{{ prefix }}[birthdayMonth]{% else %}birthdayMonth{% endif %}"
  41.       class="{% if formViolations.getViolations('/birthdayMonth') is not empty %} is-invalid{% endif %}"
  42.       {{ config('core.loginRegistration.birthdayFieldRequired') ? 'required' }}
  43.     >
  44.       {% if not data.get('birthdayMonth') %}
  45.         <wyn-option selected disabled value="">
  46.           {{ "account.personalBirthdaySelectMonth"|trans|sw_sanitize }}
  47.         </wyn-option>
  48.       {% endif %}
  49.       {% for month in range(1, 12) %}
  50.         <wyn-option value="{{ month }}"
  51.           {% if month == data.get('birthdayMonth') %} selected="selected"{% endif %}>
  52.           {{ month }}
  53.         </wyn-option>
  54.       {% endfor %}
  55.     </wyn-select>
  56.     {% block component_address_personal_fields_birthday_select_month_error %}
  57.       {{ parent() }}
  58.     {% endblock %}
  59.   </div>
  60. {% endblock %}
  61. {% block component_address_personal_fields_birthday_select_year %}
  62.   <div class="form-group col-md-2 col-4">
  63.     {% set currentYear = "now"|date('Y') %}
  64.     {% set startYear = currentYear - 120 %}
  65.     <wyn-select
  66.       name="{% if prefix %}{{ prefix }}[birthdayYear]{% else %}birthdayYear{% endif %}"
  67.       class="{% if formViolations.getViolations('/birthdayYear') is not empty %} is-invalid{% endif %}"
  68.       {{ config('core.loginRegistration.birthdayFieldRequired') ? 'required' }}
  69.     >
  70.       {% if not data.get('birthdayYear') %}
  71.         <wyn-option selected disabled value="">
  72.           {{ "account.personalBirthdaySelectYear"|trans|sw_sanitize }}
  73.         </wyn-option>
  74.       {% endif %}
  75.       {% for year in range(currentYear, startYear) %}
  76.         <wyn-option value="{{ year }}"
  77.           {% if year == data.get('birthdayYear') %} selected="selected"{% endif %}>
  78.           {{ year }}
  79.         </wyn-option>
  80.       {% endfor %}
  81.     </wyn-select>
  82.     {% block component_address_personal_fields_birthday_select_year_error %}
  83.       {{ parent() }}
  84.     {% endblock %}
  85.   </div>
  86. {% endblock %}
  87. {% block component_address_personal_account_type_select %}
  88.   {% if onlyCompanyRegistration or config('core.loginRegistration.showAccountTypeSelection') %}
  89.     <wyn-select
  90.       name="{% if prefix %}{{ prefix }}[accountType]{% else %}accountType{% endif %}"
  91.       id="{{ idPrefix ~ prefix }}accountType"
  92.       {% if onlyCompanyRegistration %}disabled{% endif %}
  93.       required
  94.       class="contact-select"
  95.       data-form-field-toggle="true"
  96.       data-form-field-toggle-target=".js-field-toggle-contact-type-company{% if customToggleTarget %}-{{ prefix }}{% endif %}"
  97.       data-form-field-toggle-value="{{ constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_BUSINESS') }}"
  98.       data-form-field-toggle-scope="{% if scope == 'parent' %}parent{% else %}all{% endif %}"
  99.       {% if scope == 'parent' %}data-form-field-toggle-parent-selector={{ parentSelector }}{% endif %}
  100.     >
  101.   {% endif %}
  102.   {% set isCompany = false %}
  103.   {% if page.address.company or data.company is not empty %}
  104.     {% set isCompany  = true %}
  105.   {% endif %}
  106.   {% if onlyCompanyRegistration or (accountType and accountType == constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_BUSINESS')) %}
  107.     {% set isCompany  = true %}
  108.   {% endif %}
  109.   {% set isLoginPage = false %}
  110.   {% if activeRoute == 'frontend.account.login.page' %}
  111.     {% set isLoginPage = true %}
  112.   {% endif %}
  113.   {% if isLoginPage %}
  114.     <wyn-option disabled selected value="">
  115.       {{ "account.personalTypeLabel"|trans|sw_sanitize }}{{ "general.required"|trans|sw_sanitize }}
  116.     </wyn-option>
  117.   {% endif %}
  118.   {% if not onlyCompanyRegistration %}
  119.     <wyn-option
  120.       value="{{ constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_PRIVATE') }}"
  121.       {% if isCompany == false and isLoginPage == false %} selected{% endif %}
  122.     >
  123.       {{ "account.personalTypePrivate"|trans|sw_sanitize }}
  124.     </wyn-option>
  125.   {% endif %}
  126.   <wyn-option
  127.     value="{{ constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_BUSINESS') }}"
  128.     {% if isCompany == true and isLoginPage == false %} selected{% endif %}
  129.   >
  130.     {{ "account.personalTypeBusiness"|trans|sw_sanitize }}
  131.   </wyn-option>
  132.   </wyn-select>
  133.   {% if onlyCompanyRegistration %}<input type="hidden" name="accountType" value="{{ constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_BUSINESS') }}">{% endif %}
  134. {% endblock %}
  135. {% block component_address_form_salutation_select %}
  136.   <wyn-select
  137.     id="{{ idPrefix ~ prefix }}personalSalutation"
  138.     class="{% if formViolations.getViolations('/salutationId') is not empty %} is-invalid{% endif %}"
  139.     name="{% if prefix %}{{ prefix }}[salutationId]{% else %}salutationId{% endif %}"
  140.     required
  141.   >
  142.     {% if not data.get('salutationId') %}
  143.       <wyn-option disabled selected value="">
  144.         {{ "account.personalSalutationPlaceholder"|trans|sw_sanitize }}
  145.       </wyn-option>
  146.     {% endif %}
  147.     {% for salutation in page.salutations %}
  148.       <wyn-option
  149.         {% if salutation.id == data.get('salutationId') %}selected{% endif %}
  150.         value="{{ salutation.id }}"
  151.       >
  152.         {{ salutation.translated.displayName }}
  153.       </wyn-option>
  154.     {% endfor %}
  155.   </wyn-select>
  156. {% endblock %}