{% extends '@ElementsDemiFrontend/Layout/layout.html.twig' %}
{% set additionalServiceItems = additionalServiceItems is defined ? additionalServiceItems : null %}
{% block content %}
{% set additionalOfferItems = [] %}
{% if additionalServiceItems is not null and additionalServiceItems|length > 0 %}
{% set additionalsGroupedByService = demi_core_configuration("getGroupAdditionalOffersByService",[]) ? true : false %}
{% set additionalOfferItems = demi_getResultArray(additionalServiceItems, false, additionalsGroupedByService) %}
{% endif %}
{{ include('@ElementsDemiFrontend/Includes/tags/step1.html.twig', {
'acco': acco,
'cart': cart,
'isPackage': isPackage,
'packageId': pId,
'additionalServiceItems': additionalServiceItems,
'isBookOnRequest': isBookOnRequest
}) }}
<div class="bg-light-gray">
{% set assumedAvailablityOfInsurance = demi_core_configuration("getInsurance",[]) is not empty and cart.getAccommodationItems()|length>0 ? true : false %}
{{ include('@ElementsDemiFrontend/Includes/cart-progress.desktop.html.twig', {
'steps': checkoutSteps == "long" ? 4 : 3,
'hasTickets':hasTickets,
'hasInsurance': checkoutSteps == "long" ? assumedAvailablityOfInsurance : false,
'hasAdditionalPrePaymentStep':checkoutSteps == "long" ?hasAdditionalPrePaymentStep : false,
'currentStep': 0
}) }}
<div class="container mt-5 overflow-hidden">
<div class="row row--gutter-width-xl-60 py-2">
<div class="col-md-8">
{% if emptyCart %}
{{ include('@ElementsDemiFrontend/Cart/includes/main-empty.desktop.html.twig', {
'error': error
}) }}
{% elseif additionalServiceItems is not null and additionalServiceItems|length > 0 %}
{{ include('@ElementsDemiFrontend/Cart/includes/aside-with-additionals.desktop.html.twig', {
'isPackage': isPackage,
'acco': acco,
'pId': pId,
'pName':pName,
'cart':cart,
'additionalOfferItems': additionalOfferItems,
'additionalOfferItemsGroupedByServices': additionalsGroupedByService,
'error': error,
'hasTickets': hasTickets ?? null,
}) }}
{% else %}
{{ include('@ElementsDemiFrontend/Cart/includes/main-without-additionals.desktop.html.twig', {
'error' : error ?? '',
'isPackage': isPackage,
'acco': acco,
'pId': pId,
'pName': pName,
'cart': cart,
'hasTickets': hasTickets ?? null,
}) }}
{% endif %}
</div>
<div class="col-md-4">
{% if emptyCart %}
{{ include('@ElementsDemiFrontend/Cart/includes/aside-empty.desktop.html.twig') }}
{% elseif additionalServiceItems is not null and additionalServiceItems|length > 0 %}
{{ include('@ElementsDemiFrontend/Cart/includes/main-with-additionals.desktop.html.twig', {
'isPackage': isPackage,
'acco': acco,
'cart': cart,
'hasTickets': hasTickets
}) }}
{% else %}
{{ include('@ElementsDemiFrontend/Cart/includes/aside-without-additionals.desktop.html.twig') }}
{% endif %}
</div>
</div>
</div>
</div>
<script data-cookieconsent="ignore">
_config.additionalOffersJson = {};
</script>
{% if additionalOfferItems is not empty and additionalsGroupedByService is not empty %}
{% set i=0 %}
{% for serviceId, items in additionalOfferItems %}
{% for item in items %}
{{ include('@ElementsDemiFrontend/includes/overlays:offer-detail.desktop.html.twig', {
'id': 'modal-' ~ item['id'],
'productId': item['id'],
'title': item['title'],
'price': item['price'],
'isPackage': isPackage,
'position': i+1
}) }}
{% set i=i+1 %}
{% endfor %}
{% endfor %}
{% elseif additionalOfferItems is not empty %}
{% for i in 0..(additionalOfferItems|length - 1) %}
{{ include('@ElementsDemiFrontend/Includes/overlays/offer-detail.desktop.html.twig', {
'id': 'modal-' ~ additionalOfferItems[i]['id'],
'productId': additionalOfferItems[i]['id'],
'title': additionalOfferItems[i]['title'],
'price': additionalOfferItems[i]['price'],
'isPackage': isPackage,
'position': i+1
}) }}
{% endfor %}
{% endif %}
{% endblock %}