custom/plugins/PickwareDhl/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. {% set pickwareDhlAllowDhlSpecificAddress = (changeShipping and not changeBilling) or (prefix in ['shippingAddress', 'address']) %}
  3. {% set pickwareDhlConfigurationExtension = page.extensions.pickwareDhlConfiguration ?? null %}
  4. {% set pickwareDhlCurrentShippingMethod = context.shippingMethod ?? null %}
  5. {% if pickwareDhlCurrentShippingMethod is not null
  6.     and pickwareDhlConfigurationExtension is not null
  7.     and pickwareDhlConfigurationExtension.shippingMethodConfigurations[pickwareDhlCurrentShippingMethod.id]
  8.     and pickwareDhlConfigurationExtension.shippingMethodConfigurations[pickwareDhlCurrentShippingMethod.id].storefrontConfig is not null
  9. %}
  10.     {% set pickwareDhlConfiguration = pickwareDhlConfigurationExtension.dhlConfig.config.rawConfig %}
  11.     {% set pickwareDhlShippingMethodConfig = pickwareDhlConfigurationExtension
  12.         .shippingMethodConfigurations[pickwareDhlCurrentShippingMethod.id].storefrontConfig
  13.     %}
  14.     {% set pickwareDhlEnablePackstation = pickwareDhlShippingMethodConfig.showPackstation ?? false %}
  15.     {% set pickwareDhlEnablePostOffice = pickwareDhlShippingMethodConfig.showPostOffice ?? false %}
  16.     {% set pickwareDhlEnablePaketshop = pickwareDhlShippingMethodConfig.showPaketshop ?? false %}
  17.     {% set pickwareDhlEnableSpecialAddressSelection =
  18.         pickwareDhlEnablePackstation or pickwareDhlEnablePostOffice or pickwareDhlEnablePaketshop
  19.     %}
  20. {% endif %}
  21. {% block component_address_form %}
  22.     <div class="pickware-dhl-component-address-form-container">
  23.         {% if pickwareDhlEnableSpecialAddressSelection and pickwareDhlAllowDhlSpecificAddress %}
  24.             {% sw_include 'storefront/pickware-dhl/address-form/address-radio-buttons.html.twig' with {
  25.                 'pickwareDhlEnablePackstation': pickwareDhlEnablePackstation,
  26.                 'pickwareDhlEnablePostOffice': pickwareDhlEnablePostOffice,
  27.                 'pickwareDhlEnablePaketshop': pickwareDhlEnablePaketshop,
  28.             } %}
  29.         {% endif %}
  30.         {{ parent() }}
  31.     </div>
  32. {% endblock %}
  33. {% block component_address_form_address_fields %}
  34.     {% if pickwareDhlEnableSpecialAddressSelection and pickwareDhlAllowDhlSpecificAddress %}
  35.         <div class="pickware-dhl-regular-address-form-container">
  36.             <div class="pickware-dhl-regular-address-form">
  37.                 {{ parent() }}
  38.             </div>
  39.         </div>
  40.         <div class="pickware-dhl-packstation-address-form-container">
  41.             <div class="pickware-dhl-packstation-address-form">
  42.                 {% sw_include 'storefront/pickware-dhl/address-form/special-address-form.html.twig' with {
  43.                     'data': data,
  44.                     'addressTypeKey': 'packstation',
  45.                     'specialAddressNumberFieldLabel': 'pickware-dhl.special-addresses.storefront.packstation.number-field-label',
  46.                     'specialAddressNumberFieldPlaceholder': 'pickware-dhl.special-addresses.storefront.packstation.number-field-placeholder',
  47.                 } %}
  48.             </div>
  49.         </div>
  50.         <div class="pickware-dhl-post-office-address-form-container">
  51.             <div class="pickware-dhl-post-office-address-form">
  52.                 {% sw_include 'storefront/pickware-dhl/address-form/special-address-form.html.twig' with {
  53.                     'data': data,
  54.                     'addressTypeKey': 'post-office',
  55.                     'specialAddressNumberFieldLabel': 'pickware-dhl.special-addresses.storefront.post-office.number-field-label',
  56.                     'specialAddressNumberFieldPlaceholder': 'pickware-dhl.special-addresses.storefront.post-office.number-field-placeholder',
  57.                 } %}
  58.             </div>
  59.         </div>
  60.         <div class="pickware-dhl-paketshop-address-form-container">
  61.             <div class="pickware-dhl-paketshop-address-form">
  62.                 {% sw_include 'storefront/pickware-dhl/address-form/special-address-form.html.twig' with {
  63.                     'data': data,
  64.                     'addressTypeKey': 'paketshop',
  65.                     'specialAddressNumberFieldLabel': 'pickware-dhl.special-addresses.storefront.paketshop.number-field-label',
  66.                     'specialAddressNumberFieldPlaceholder': 'pickware-dhl.special-addresses.storefront.paketshop.number-field-placeholder',
  67.                 } %}
  68.             </div>
  69.         </div>
  70.     {% else %}
  71.         {{ parent() }}
  72.     {% endif %}
  73. {% endblock %}