custom/plugins/ThemeOkeonline/src/Resources/views/storefront/page/checkout/cart/index.html.twig line 1

Open in your IDE?
  1. {% sw_extends '@parent/storefront/page/checkout/cart/index.html.twig' %}
  2. {% use '@ThemeOkeOnline/storefront/page/checkout/_oo-page-trait.html.twig' %}
  3. {# Hiding bottom_content of trait #}
  4. {% block page_checkout_bottom_content_container %}
  5.     {% if false %}{{ parent() }}{% endif %}
  6. {% endblock %}
  7. {% set proceedIcon = theme_config('cartSettingsGeneralDisplayProceedIcon') %}
  8. {% set displayShippingCountry = theme_config('cartSettingsGeneralDisplayShippingCountry') %}
  9. {% set displayShippingMethod = theme_config('cartSettingsGeneralDisplayShippingMethod') %}
  10. {% set displayBlancoShipping = theme_config('cartSettingsGeneralDisplayBlancoShipping') %}
  11. {% set displayPaymentMethod = theme_config('cartSettingsGeneralDisplayPaymentMethod') %}
  12. {% set displayTitleInStepperbar = theme_config('cartSettingsGeneralDisplayTitleInStepperbar') %}
  13. {% set showShippingCostInput = theme_config('cartSettingsGeneralDisplayShippingCostInput') %}
  14. {% set shippingCostInputCollapsable = theme_config('cartSettingsGeneralCollapsableShippingCostInput') %}
  15. {% set shippingCostInputVersion = theme_config('cartSettingsGeneralShippingCostInputVersion') %}
  16. {% set showProductNumberInMain = theme_config('cartSettingsGeneralDisplayProductNumberInput') %}
  17. {% set showVoucherInAside = theme_config('cartSettingsGeneralDisplayVoucherInSidebar') and theme_config('cartSettingsGeneralDisplayVoucher') %}
  18. {% set showVoucherInMain = (showVoucherInAside == false) and theme_config('cartSettingsGeneralDisplayVoucher') %}
  19. {% set showDeliveryDateInAside = theme_config('cartSettingsGeneralDisplayDeliveryDateInSidebar') and theme_config('cartSettingsGeneralDisplayDeliveryDate') %}
  20. {% set showDeliveryDateInMain = (showDeliveryDateInAside == false) and theme_config('cartSettingsGeneralDisplayDeliveryDate') %}
  21. {% set showUpsellInMain = theme_config('cartSettingsGeneralDisplayUpsell')|default(false) %}
  22. {% set cartSettingsShippingPriceTaxTypeGross = theme_config('cartSettingsShippingPriceTaxTypeGross')|default(true) %}
  23. {% block page_checkout_main_content %}
  24.     {% sw_include '@parent/storefront/page/checkout/checkout-warning.html.twig' %}
  25.     {% block page_checkout_cart %}
  26.         {% block page_checkout_cart_header %}
  27.             {% if displayTitleInStepperbar is not true %}
  28.                 <h2 class="cart-main-header">
  29.                     {{ "oo.checkout.cartHeader"|trans|sw_sanitize }}
  30.                 </h2>
  31.             {% endif %}
  32.         {% endblock %}
  33.         {% block page_checkout_cart_product_table %}
  34.             <div class="card checkout-product-table">
  35.                 <div class="card-body">
  36.                     {% block page_checkout_cart_table_header %}
  37.                     {% endblock %}
  38.                     {% block page_checkout_cart_table_items %}
  39.                         {% for lineItem in page.cart.lineItems %}
  40.                             {% block page_checkout_cart_table_item %}
  41.                                 {% block page_checkout_item %}
  42.                                     {% sw_include '@parent/storefront/page/checkout/checkout-item.html.twig' %}
  43.                                 {% endblock %}
  44.                             {% endblock %}
  45.                         {% endfor %}
  46.                     {% endblock %}
  47.                     {% if showUpsellInMain %}
  48.                         {% block page_checkout_cart_table_oo_upsell_wrapper %}
  49.                             {% sw_include '@parent/storefront/page/checkout/cart/oo-upsell.html.twig' %}
  50.                         {% endblock %}
  51.                     {% endif %}
  52.                 </div>
  53.             </div>
  54.             {% block page_checkout_oo_cart_product_table_footer %}
  55.             
  56.             {% endblock %}
  57.             {% if showDeliveryDateInMain %}
  58.                 {{ block('oo_delivery_week_selector') }}
  59.             {% endif %}
  60.         {% endblock %}
  61.         {% block page_checkout_cart_hidden_line_items_information %}{{ parent() }}{% endblock %}
  62.         {% block page_checkout_cart_add_product_and_shipping %}
  63.             <div class="d-flex flex-column flex-md-row justify-content-between">
  64.                 {% if showProductNumberInMain or showVoucherInMain %}
  65.                     {% block page_checkout_cart_add_product %}
  66.                         <div class="cart-add-product-container">
  67.                             {% if showProductNumberInMain %}
  68.                                 <form action="{{ path('frontend.checkout.product.add-by-number') }}"
  69.                                       data-form-csrf-handler="true"
  70.                                       class="cart-add-product"
  71.                                       method="post">
  72.                                     {% block page_checkout_cart_add_product_csrf %}{{ parent() }}{% endblock %}
  73.                                     {% block page_checkout_cart_add_product_redirect %}{{ parent() }}{% endblock %}
  74.                                     {% block page_checkout_cart_add_product_input_group %}{{ parent() }}{% endblock %}
  75.                                 </form>
  76.                             {% endif %}
  77.                             {% if showVoucherInMain %}
  78.                                 {{ block('page_checkout_cart_add_promotion') }}
  79.                             {% endif %}
  80.                         </div>
  81.                     {% endblock %}
  82.                 {% endif %}
  83.                 {% if showShippingCostInput %}
  84.                     {% block page_checkout_cart_shipping_costs %}
  85.                         <div class="cart-shipping-costs-container align-self-start flex-grow-1">
  86.                             <form name="precalc"
  87.                                   method="post"
  88.                                   action="{{ path('frontend.checkout.configure') }}"
  89.                                   data-form-auto-submit="true">
  90.                                 {% block page_checkout_cart_shipping_costs_csrf %}{{ parent() }}{% endblock %}
  91.                                 {% block page_checkout_cart_shipping_costs_trigger %}
  92.                                     {% if shippingCostInputCollapsable %}
  93.                                         {{ parent() }}
  94.                                     {% endif %}
  95.                                 {% endblock %}
  96.                                 {#{% block page_checkout_cart_shipping_costs_form_group %}{{ parent() }}{% endblock %}#}
  97.                                 {% block page_checkout_cart_shipping_costs_form_group %}
  98.                                     <div class="{{ shippingCostInputCollapsable ? 'collapse' : 'no-collapse' }} shipping-cost-{{ shippingCostInputVersion }}" id="{{ shippingCostInputCollapsable ? 'collapseShippingCost' : 'noCollapseShippingCost' }}">
  99.                                         {% block page_checkout_cart_shipping_costs_form_group_country %}
  100.                                             {% if shippingCostInputVersion == 'version-01' %}
  101.                                                 {{ parent() }}
  102.                                             {% else %} {# Version-02 or up #}
  103.                                                 {% if not context.customer %}
  104.                                                     <input type="hidden" class="fancy-custom-select" type="text" id="countryId" name="countryId" value="{{ context.shippingLocation.country.id }}" />
  105.                                                     {% if displayShippingCountry %}
  106.                                                         <div class="fancy-form-group">
  107.                                                             {%  set okeonline_virtual_select_options_country = {
  108.                                                                 inputFieldId: 'countryId',
  109.                                                             } %}
  110.                                                             <div class="fancy-custom-select-title countryId h2">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</div>
  111.                                                             <div class="fancy-custom-select-description">{{ "oo.checkout.countrySelectorDescription"|trans|sw_sanitize }}</div>
  112.                                                             <div class="fancy-custom-select-options">
  113.                                                                 {% for country in page.countries %}
  114.                                                                     <span data-oo-fancy-select-plugin data-value="{{ country.id }}" data-inputFieldId="countryId"
  115.                                                                             {{ country.id == context.shippingLocation.country.id ? 'class="active"' : '' }}>
  116.                                                                         <span class="fancy-title-container">
  117.                                                                             {{ country.translated.name }}
  118.                                                                         </span>
  119.                                                                     </span>
  120.                                                                 {% endfor %}
  121.                                                             </div>
  122.                                                         </div>
  123.                                                     {% endif %}
  124.                                                 {% endif %}
  125.                                             {% endif %}
  126.                                         {% endblock %}
  127.                                         {% block page_checkout_cart_shipping_costs_form_group_payment_method %}
  128.                                             {% if shippingCostInputVersion == 'version-01' %}
  129.                                                 {{ parent() }}
  130.                                             {% else %} {# Version-02 or up #}
  131.                                                 <input type="hidden" class="fancy-custom-select" type="text" id="paymentMethodId" name="paymentMethodId" value="{{ context.paymentMethod.id }}" />
  132.                                                 {% if displayPaymentMethod %}
  133.                                                     <div class="fancy-form-group">
  134.                                                         <div class="fancy-custom-select-title paymentMethodId h2">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</div>
  135.                                                         <div class="fancy-custom-select-description">{{ "oo.checkout.paymentMethodDescription"|trans|sw_sanitize }}</div>
  136.                                                         <div class="fancy-custom-select-options">
  137.                                                             {% for payment in page.paymentMethods %}
  138.                                                                 <span data-oo-fancy-select-plugin data-value="{{ payment.id }}" data-inputFieldId="paymentMethodId"
  139.                                                                         {% if payment.id == context.paymentMethod.id %} class="active"{% endif %}>
  140.                                                                     <span class="fancy-title-container">
  141.                                                                            {{ payment.translated.name }}
  142.                                                                     </span>
  143.                                                                     <div class="fancy-price-container">
  144.                                                                         €0,00
  145.                                                                     </div>
  146.                                                                 </span>
  147.                                                             {% endfor %}
  148.                                                         </div>
  149.                                                     </div>
  150.                                                 {% endif %}
  151.                                             {% endif %}
  152.                                         {% endblock %}
  153.                                         {% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
  154.                                             {# <!-- hier moet dagen komen, zie design: https://xd.adobe.com/view/29ef1c94-c24a-4025-8c40-e51e15395bd5-7cbc/screen/c0acbbc5-8905-4cbc-b034-d6c747a50e22 -->
  155.                                             <!-- geen toeslagen per dag tot nu toe --> #}
  156.                                             {#{{ dump(page.extensions.shipmentExtension) }}#}
  157.                                             {% if shippingCostInputVersion == 'version-01' %}
  158.                                                 {{ parent() }}
  159.                                             {% else %} {# Version-02 or up #}
  160.                                                 <input type="hidden" class="fancy-custom-select" type="text" id="shippingMethodId" name="shippingMethodId" value="{{ context.shippingMethod.id }}" />
  161.                                                 {% if displayShippingMethod %}
  162.                                                     <div class="fancy-form-group">
  163.                                                         {%  set okeonline_virtual_select_options_shipping = {
  164.                                                             inputFieldId: 'shippingMethodId',
  165.                                                         } %}
  166.                                                         <div class="fancy-custom-select-title shippingMethodId h2">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</div>
  167.                                                         <div class="fancy-custom-select-description">{{ "oo.checkout.shippingMethodDescription"|trans|sw_sanitize }}</div>
  168.                                                         <div class="fancy-custom-select-options">
  169.                                                             {% for shipping in page.shippingMethods %}
  170.                                                                 {# Functionallity in OkeonlinePlaatprintenShipping. BC compatible, if plugin not installed #}
  171.                                                                 {# if belt-size of the greatest belt is higher than the maximum of the defined belt-size for the shipping-method or lower than the min belt, remove the full option form the page. The user may not see and choose the item #}
  172.                                                                 {# if the chosen day is not available for the shipping-method, do show the method, but add disabled class and remove choose functionallity #}
  173.                                                                 
  174.                                                                 {# fallback / BC #}
  175.                                                                 {% set removeBecauseOfBeltSize = false %}
  176.                                                                 {% set available = true %}
  177.                                                                 {# check if belt of greatest belt > the defined max belt || < the defined min belt --> remove option completely #}
  178.                                                                 {% if page.extensions.beltCalculations.all() | first > shipping.customFields.custom_belt_max | default(100000) or page.extensions.beltCalculations.all() | first < shipping.customFields.custom_belt_min %}
  179.                                                                     {% set removeBecauseOfBeltSize = true %}
  180.                                                                 {% endif %}
  181.                                                                 {# check if chosen delivery day is possile for shipping-method. If not, disable the option #}
  182.                                                                 {% if not removeBecauseOfBeltSize and shipping.extensions.shippingMethodAvailableDays and page.extensions.deliveryDateSelected.getSelectedDate() %}
  183.                                                                     {% set chosenDay = page.extensions.deliveryDateSelected.getSelectedDate() | date('l') | lower %}
  184.                                                                     {% set available = shipping.extensions.shippingMethodAvailableDays.getDayAvailability(chosenDay) %}
  185.                                                                 {% endif %}
  186.                                                                 {# when option should not be removed, show it #}
  187.                                                                 {% if not removeBecauseOfBeltSize %}
  188.                                                                     <span {% if available %}data-oo-fancy-select-plugin{% endif %} data-value="{{ shipping.id }}" data-inputFieldId="shippingMethodId"
  189.                                                                             class="{% if shipping.id == context.shippingMethod.id %} active{% endif %}{% if not available %} disabled{% endif %}">
  190.                                                                         <span class="fancy-title-container"> {{ shipping.translated.name }}</span>
  191.                                                                         {% if shipping.media %}
  192.                                                                             <div class="fancy-image-container">
  193.                                                                                 {% sw_thumbnails 'oo-element-banner-box-column-image' with {
  194.                                                                                     media: shipping.media,
  195.                                                                                     layout: 'boxed',
  196.                                                                                     sizes: {
  197.                                                                                         'default': '25px'
  198.                                                                                     },
  199.                                                                                     attributes: {
  200.                                                                                         'alt': shipping.translated.name|lower|replace({' ': '-'}) ~ '-image',
  201.                                                                                     }
  202.                                                                                 } %}
  203.                                                                             </div>
  204.                                                                         {% endif %}
  205.                                                                         <div class="fancy-price-container">
  206.                                                                             {{ shipping.prices.first.currencyPrice.first.net|currency }}
  207.                                                                         </div>
  208.                                                                     </span>
  209.                                                                     {% endif %}
  210.                                                             {% endfor %}
  211.                                                         </div>
  212.                                                     </div>
  213.                                                 {% endif %}
  214.                                                 {% if displayBlancoShipping %}
  215.                                                     <div class="fancy-form-group">
  216.                                                         {%  set okeonline_virtual_select_options_shipping = {
  217.                                                             inputFieldId: 'shippingMethodId',
  218.                                                         } %}
  219.                                                         <div class="fancy-custom-select-title blancoShipping h2">{{ "oo.checkout.blancoShippingTitle"|trans|sw_sanitize }}</div>
  220.                                                         <div class="fancy-custom-select-description">{{ "oo.checkout.blancoShippingDescription"|trans|sw_sanitize }}</div>
  221.                                                         <div class="fancy-custom-checkbox">
  222.                                                             <input type="checkbox" id="blancoShipping" name="blancoShipping" value="true" {{ page.cart.extensions.blancoShipping.blancoShipping is true ? 'checked="checked"' : '' }}>
  223.                                                             <label for="blancoShipping"> {{ "oo.checkout.blancoShippingLabel"|trans|sw_sanitize }}</label>
  224.                                                         </div>
  225.                                                     </div>
  226.                                                 {% endif %}                   
  227.                                             {% endif %}
  228.                                         {% endblock %}
  229.                                         <input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
  230.                                     </div>
  231.                                 {% endblock %}
  232.                             </form>
  233.                         </div>
  234.                     {% endblock %}
  235.                 {% endif %}
  236.                 {# Created a new block that will include a block from the parent.#}
  237.                 {% block page_checkout_cart_bottom_content %}
  238.                     {{ block('page_checkout_bottom_content') }}
  239.                 {% endblock %}
  240.             </div>
  241.         {% endblock %}
  242.     {% endblock %}{% endblock %}
  243. {# Whole block needs to be included since its in the trait #}
  244. {% block page_checkout_aside_actions %}
  245.     {% if showDeliveryDateInAside %}
  246.         {% block oo_delivery_week_selector %}
  247.             {% if page.extensions.deliveryDates or page.extensions.deliveryDateWeeks %}
  248.                 {{ parent() }}
  249.             {% endif %}
  250.         {% endblock %}
  251.     {% endif %}
  252.     <div class="checkout-aside-action">
  253.         {% if showVoucherInAside %}
  254.             {% block page_checkout_cart_add_promotion %}
  255.                {{ parent() }}
  256.             {% endblock %}
  257.         {% endif %}
  258.     </div>
  259.     {#{% block page_checkout_cart_action_proceed %}{{ parent() }}{% endblock %}#}
  260.     {% block page_checkout_cart_action_proceed %}
  261.         <div class="checkout-aside-action">
  262.             <a href="{{ path('frontend.checkout.confirm.page') }}"
  263.                class="btn btn-primary btn-block btn-lg begin-checkout-btn"
  264.                title="{{ "checkout.proceedLink"|trans|striptags }}">
  265.                 {{ "checkout.proceedLink"|trans|sw_sanitize }}
  266.                 {% block oo_proceed_icon %}
  267.                     {% if proceedIcon is not empty %}
  268.                         {% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': proceedIcon, 'size': 'xs'} %}
  269.                     {% endif %}
  270.                 {% endblock %}
  271.             </a>
  272.         </div>
  273.     {% endblock %}
  274. {% endblock %}
  275. {# Update submit button of promotion-box#}
  276.  {% block page_checkout_cart_add_promotion_submit %}
  277.      <div>
  278.          <button class="ml-2 btn btn-secondary"
  279.                  type="submit"
  280.                  id="addPromotion">
  281.              Code toevoegen
  282.          </button>
  283.      </div>
  284.  {% endblock %}
  285. {# Add steps to top #}
  286. {% block base_main %}
  287.     {% sw_include '@parent/storefront/page/checkout/checkout-steps.html.twig' %}
  288.     {{ parent() }}
  289. {% endblock %}
  290. {# Appending footer #}
  291. {% block page_checkout %}
  292.     {{ parent() }}
  293.     <div class="pt-4">
  294.         {% sw_include '@parent/storefront/page/checkout/checkout-custom-footer.html.twig' %}
  295.     </div>
  296. {% endblock %}