{% sw_extends '@parent/storefront/page/checkout/cart/index.html.twig' %}
{% use '@ThemeOkeOnline/storefront/page/checkout/_oo-page-trait.html.twig' %}
{# Hiding bottom_content of trait #}
{% block page_checkout_bottom_content_container %}
{% if false %}{{ parent() }}{% endif %}
{% endblock %}
{% set proceedIcon = theme_config('cartSettingsGeneralDisplayProceedIcon') %}
{% set displayShippingCountry = theme_config('cartSettingsGeneralDisplayShippingCountry') %}
{% set displayShippingMethod = theme_config('cartSettingsGeneralDisplayShippingMethod') %}
{% set displayBlancoShipping = theme_config('cartSettingsGeneralDisplayBlancoShipping') %}
{% set displayPaymentMethod = theme_config('cartSettingsGeneralDisplayPaymentMethod') %}
{% set displayTitleInStepperbar = theme_config('cartSettingsGeneralDisplayTitleInStepperbar') %}
{% set showShippingCostInput = theme_config('cartSettingsGeneralDisplayShippingCostInput') %}
{% set shippingCostInputCollapsable = theme_config('cartSettingsGeneralCollapsableShippingCostInput') %}
{% set shippingCostInputVersion = theme_config('cartSettingsGeneralShippingCostInputVersion') %}
{% set showProductNumberInMain = theme_config('cartSettingsGeneralDisplayProductNumberInput') %}
{% set showVoucherInAside = theme_config('cartSettingsGeneralDisplayVoucherInSidebar') and theme_config('cartSettingsGeneralDisplayVoucher') %}
{% set showVoucherInMain = (showVoucherInAside == false) and theme_config('cartSettingsGeneralDisplayVoucher') %}
{% set showDeliveryDateInAside = theme_config('cartSettingsGeneralDisplayDeliveryDateInSidebar') and theme_config('cartSettingsGeneralDisplayDeliveryDate') %}
{% set showDeliveryDateInMain = (showDeliveryDateInAside == false) and theme_config('cartSettingsGeneralDisplayDeliveryDate') %}
{% set showUpsellInMain = theme_config('cartSettingsGeneralDisplayUpsell')|default(false) %}
{% set cartSettingsShippingPriceTaxTypeGross = theme_config('cartSettingsShippingPriceTaxTypeGross')|default(true) %}
{% block page_checkout_main_content %}
{% sw_include '@parent/storefront/page/checkout/checkout-warning.html.twig' %}
{% block page_checkout_cart %}
{% block page_checkout_cart_header %}
{% if displayTitleInStepperbar is not true %}
<h2 class="cart-main-header">
{{ "oo.checkout.cartHeader"|trans|sw_sanitize }}
</h2>
{% endif %}
{% endblock %}
{% block page_checkout_cart_product_table %}
<div class="card checkout-product-table">
<div class="card-body">
{% block page_checkout_cart_table_header %}
{% endblock %}
{% block page_checkout_cart_table_items %}
{% for lineItem in page.cart.lineItems %}
{% block page_checkout_cart_table_item %}
{% block page_checkout_item %}
{% sw_include '@parent/storefront/page/checkout/checkout-item.html.twig' %}
{% endblock %}
{% endblock %}
{% endfor %}
{% endblock %}
{% if showUpsellInMain %}
{% block page_checkout_cart_table_oo_upsell_wrapper %}
{% sw_include '@parent/storefront/page/checkout/cart/oo-upsell.html.twig' %}
{% endblock %}
{% endif %}
</div>
</div>
{% block page_checkout_oo_cart_product_table_footer %}
{% endblock %}
{% if showDeliveryDateInMain %}
{{ block('oo_delivery_week_selector') }}
{% endif %}
{% endblock %}
{% block page_checkout_cart_hidden_line_items_information %}{{ parent() }}{% endblock %}
{% block page_checkout_cart_add_product_and_shipping %}
<div class="d-flex flex-column flex-md-row justify-content-between">
{% if showProductNumberInMain or showVoucherInMain %}
{% block page_checkout_cart_add_product %}
<div class="cart-add-product-container">
{% if showProductNumberInMain %}
<form action="{{ path('frontend.checkout.product.add-by-number') }}"
data-form-csrf-handler="true"
class="cart-add-product"
method="post">
{% block page_checkout_cart_add_product_csrf %}{{ parent() }}{% endblock %}
{% block page_checkout_cart_add_product_redirect %}{{ parent() }}{% endblock %}
{% block page_checkout_cart_add_product_input_group %}{{ parent() }}{% endblock %}
</form>
{% endif %}
{% if showVoucherInMain %}
{{ block('page_checkout_cart_add_promotion') }}
{% endif %}
</div>
{% endblock %}
{% endif %}
{% if showShippingCostInput %}
{% block page_checkout_cart_shipping_costs %}
<div class="cart-shipping-costs-container align-self-start flex-grow-1">
<form name="precalc"
method="post"
action="{{ path('frontend.checkout.configure') }}"
data-form-auto-submit="true">
{% block page_checkout_cart_shipping_costs_csrf %}{{ parent() }}{% endblock %}
{% block page_checkout_cart_shipping_costs_trigger %}
{% if shippingCostInputCollapsable %}
{{ parent() }}
{% endif %}
{% endblock %}
{#{% block page_checkout_cart_shipping_costs_form_group %}{{ parent() }}{% endblock %}#}
{% block page_checkout_cart_shipping_costs_form_group %}
<div class="{{ shippingCostInputCollapsable ? 'collapse' : 'no-collapse' }} shipping-cost-{{ shippingCostInputVersion }}" id="{{ shippingCostInputCollapsable ? 'collapseShippingCost' : 'noCollapseShippingCost' }}">
{% block page_checkout_cart_shipping_costs_form_group_country %}
{% if shippingCostInputVersion == 'version-01' %}
{{ parent() }}
{% else %} {# Version-02 or up #}
{% if not context.customer %}
<input type="hidden" class="fancy-custom-select" type="text" id="countryId" name="countryId" value="{{ context.shippingLocation.country.id }}" />
{% if displayShippingCountry %}
<div class="fancy-form-group">
{% set okeonline_virtual_select_options_country = {
inputFieldId: 'countryId',
} %}
<div class="fancy-custom-select-title countryId h2">{{ "checkout.shippingCountry"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-description">{{ "oo.checkout.countrySelectorDescription"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-options">
{% for country in page.countries %}
<span data-oo-fancy-select-plugin data-value="{{ country.id }}" data-inputFieldId="countryId"
{{ country.id == context.shippingLocation.country.id ? 'class="active"' : '' }}>
<span class="fancy-title-container">
{{ country.translated.name }}
</span>
</span>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
{% endif %}
{% endblock %}
{% block page_checkout_cart_shipping_costs_form_group_payment_method %}
{% if shippingCostInputVersion == 'version-01' %}
{{ parent() }}
{% else %} {# Version-02 or up #}
<input type="hidden" class="fancy-custom-select" type="text" id="paymentMethodId" name="paymentMethodId" value="{{ context.paymentMethod.id }}" />
{% if displayPaymentMethod %}
<div class="fancy-form-group">
<div class="fancy-custom-select-title paymentMethodId h2">{{ "checkout.paymentMethod"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-description">{{ "oo.checkout.paymentMethodDescription"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-options">
{% for payment in page.paymentMethods %}
<span data-oo-fancy-select-plugin data-value="{{ payment.id }}" data-inputFieldId="paymentMethodId"
{% if payment.id == context.paymentMethod.id %} class="active"{% endif %}>
<span class="fancy-title-container">
{{ payment.translated.name }}
</span>
<div class="fancy-price-container">
€0,00
</div>
</span>
{% endfor %}
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}
{% block page_checkout_cart_shipping_costs_form_group_shipping_method %}
{# <!-- hier moet dagen komen, zie design: https://xd.adobe.com/view/29ef1c94-c24a-4025-8c40-e51e15395bd5-7cbc/screen/c0acbbc5-8905-4cbc-b034-d6c747a50e22 -->
<!-- geen toeslagen per dag tot nu toe --> #}
{#{{ dump(page.extensions.shipmentExtension) }}#}
{% if shippingCostInputVersion == 'version-01' %}
{{ parent() }}
{% else %} {# Version-02 or up #}
<input type="hidden" class="fancy-custom-select" type="text" id="shippingMethodId" name="shippingMethodId" value="{{ context.shippingMethod.id }}" />
{% if displayShippingMethod %}
<div class="fancy-form-group">
{% set okeonline_virtual_select_options_shipping = {
inputFieldId: 'shippingMethodId',
} %}
<div class="fancy-custom-select-title shippingMethodId h2">{{ "checkout.shippingMethod"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-description">{{ "oo.checkout.shippingMethodDescription"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-options">
{% for shipping in page.shippingMethods %}
{# Functionallity in OkeonlinePlaatprintenShipping. BC compatible, if plugin not installed #}
{# 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 #}
{# if the chosen day is not available for the shipping-method, do show the method, but add disabled class and remove choose functionallity #}
{# fallback / BC #}
{% set removeBecauseOfBeltSize = false %}
{% set available = true %}
{# check if belt of greatest belt > the defined max belt || < the defined min belt --> remove option completely #}
{% if page.extensions.beltCalculations.all() | first > shipping.customFields.custom_belt_max | default(100000) or page.extensions.beltCalculations.all() | first < shipping.customFields.custom_belt_min %}
{% set removeBecauseOfBeltSize = true %}
{% endif %}
{# check if chosen delivery day is possile for shipping-method. If not, disable the option #}
{% if not removeBecauseOfBeltSize and shipping.extensions.shippingMethodAvailableDays and page.extensions.deliveryDateSelected.getSelectedDate() %}
{% set chosenDay = page.extensions.deliveryDateSelected.getSelectedDate() | date('l') | lower %}
{% set available = shipping.extensions.shippingMethodAvailableDays.getDayAvailability(chosenDay) %}
{% endif %}
{# when option should not be removed, show it #}
{% if not removeBecauseOfBeltSize %}
<span {% if available %}data-oo-fancy-select-plugin{% endif %} data-value="{{ shipping.id }}" data-inputFieldId="shippingMethodId"
class="{% if shipping.id == context.shippingMethod.id %} active{% endif %}{% if not available %} disabled{% endif %}">
<span class="fancy-title-container"> {{ shipping.translated.name }}</span>
{% if shipping.media %}
<div class="fancy-image-container">
{% sw_thumbnails 'oo-element-banner-box-column-image' with {
media: shipping.media,
layout: 'boxed',
sizes: {
'default': '25px'
},
attributes: {
'alt': shipping.translated.name|lower|replace({' ': '-'}) ~ '-image',
}
} %}
</div>
{% endif %}
<div class="fancy-price-container">
{{ shipping.prices.first.currencyPrice.first.net|currency }}
</div>
</span>
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
{% if displayBlancoShipping %}
<div class="fancy-form-group">
{% set okeonline_virtual_select_options_shipping = {
inputFieldId: 'shippingMethodId',
} %}
<div class="fancy-custom-select-title blancoShipping h2">{{ "oo.checkout.blancoShippingTitle"|trans|sw_sanitize }}</div>
<div class="fancy-custom-select-description">{{ "oo.checkout.blancoShippingDescription"|trans|sw_sanitize }}</div>
<div class="fancy-custom-checkbox">
<input type="checkbox" id="blancoShipping" name="blancoShipping" value="true" {{ page.cart.extensions.blancoShipping.blancoShipping is true ? 'checked="checked"' : '' }}>
<label for="blancoShipping"> {{ "oo.checkout.blancoShippingLabel"|trans|sw_sanitize }}</label>
</div>
</div>
{% endif %}
{% endif %}
{% endblock %}
<input type="hidden" name="redirectTo" value="frontend.checkout.cart.page">
</div>
{% endblock %}
</form>
</div>
{% endblock %}
{% endif %}
{# Created a new block that will include a block from the parent.#}
{% block page_checkout_cart_bottom_content %}
{{ block('page_checkout_bottom_content') }}
{% endblock %}
</div>
{% endblock %}
{% endblock %}{% endblock %}
{# Whole block needs to be included since its in the trait #}
{% block page_checkout_aside_actions %}
{% if showDeliveryDateInAside %}
{% block oo_delivery_week_selector %}
{% if page.extensions.deliveryDates or page.extensions.deliveryDateWeeks %}
{{ parent() }}
{% endif %}
{% endblock %}
{% endif %}
<div class="checkout-aside-action">
{% if showVoucherInAside %}
{% block page_checkout_cart_add_promotion %}
{{ parent() }}
{% endblock %}
{% endif %}
</div>
{#{% block page_checkout_cart_action_proceed %}{{ parent() }}{% endblock %}#}
{% block page_checkout_cart_action_proceed %}
<div class="checkout-aside-action">
<a href="{{ path('frontend.checkout.confirm.page') }}"
class="btn btn-primary btn-block btn-lg begin-checkout-btn"
title="{{ "checkout.proceedLink"|trans|striptags }}">
{{ "checkout.proceedLink"|trans|sw_sanitize }}
{% block oo_proceed_icon %}
{% if proceedIcon is not empty %}
{% sw_include "@parent/storefront/utilities/icon.html.twig" ignore missing with { 'name': proceedIcon, 'size': 'xs'} %}
{% endif %}
{% endblock %}
</a>
</div>
{% endblock %}
{% endblock %}
{# Update submit button of promotion-box#}
{% block page_checkout_cart_add_promotion_submit %}
<div>
<button class="ml-2 btn btn-secondary"
type="submit"
id="addPromotion">
Code toevoegen
</button>
</div>
{% endblock %}
{# Add steps to top #}
{% block base_main %}
{% sw_include '@parent/storefront/page/checkout/checkout-steps.html.twig' %}
{{ parent() }}
{% endblock %}
{# Appending footer #}
{% block page_checkout %}
{{ parent() }}
<div class="pt-4">
{% sw_include '@parent/storefront/page/checkout/checkout-custom-footer.html.twig' %}
</div>
{% endblock %}