{#
/**
* @var \\Pimcore\\Templating\\GlobalVariables app
* #
* @var productData array
* @var accommodation \\Elements\\Demi\\Model\\AccommodationServiceProvider
* @var settlerCode string
* @var bookOnRequest bool
* @var availabilityIsChecked bool
* @var hasSingleRoomRow bool
*/ #}
{% if searchParam is not defined or searchParam.getDateFrom() is empty %}
{% set fromDate = null %}
{% else %}
{% set fromDate = demi_getSearchFrom() %}
{% endif %}
{% if productData is iterable and productData.roomRow[0] is defined and productData.products[0] is defined%}
{% set possibleIndices = productData.roomRow | keys %}
{% set i = possibleIndices | first %}
{% set roomRow = productData.roomRow[i].getRowObject() %}
{% set product = productData.products[i] %}
{% set accommodationProduct = pimcore_object(product.getProductId()) %}
{% if accommodationProduct and accommodationProduct.isPublished() %}
<li>
{% if product %}
{% if roomRow %}
{% set priceData = product.getPriceData() %}
{% set price = product.getPrice() %}
{% set showVacancy = true %}
{% set showSelection = true %}
{% set vacancyCount = product.getUnits() %}
{% else %}
{% set priceData = null %}
{% set price = product.getBasePrice() %}
{% set showVacancy = false %}
{% set showSelection = false %}
{% set vacancyCount = 0 %}
{% set priceInfo = product.getPriceInfo() ?? null %}
{% set priceInfoText = priceInfo is not null ? include('@ElementsDemiFrontend/Includes/priceInfoStr.html.twig', {'type' : priceInfo.type ?? null, 'nights' : priceInfo.nights ?? null}) : '' %}
{% endif %}
{% endif %}
{% set images = accommodationProduct ? demi_getRoomPictures(accommodationProduct,fromDate) : [] %}
{% set moreRoomRows = true %}
<div class="js-room-selection__room my-3"
data-availability-reference-id="{{ product.getAvailabilityReference() is same as "Service" ? product.getServiceId() : product.getProductId() }}"
data-room-id="{{ product.getProductId() }}"
data-tracking-variant="{{ demi_impressionVariant(accommodationProduct ?: product, tvbPackage) }}"
data-tracking-variant-id="{{ product.getProductId() }}"
data-settler-code="{{ settlerCode }}"
data-booking-type="{{ product.getBookable() ? 'bookable' : 'onrequest' }}">
<div class="card">
{% if not availabilityIsChecked or not hasSingleRoomRow %}
{% set firstPossibleIndex = productData.products | keys | first%}
{% set product = productData.products[firstPossibleIndex] %}
{{ include("@ElementsDemiFrontend/Includes/teaser/room-teaser-content.desktop.html.twig", {
"count" : firstPossibleIndex,
"product" : product,
"productData" : productData,
"images" : images,
"tableOnSide" : true,
"hasSingleRoomRow" : true,
"availabilityIsChecked" : availabilityIsChecked,
"priceData" : priceData,
"priceInfoText" : priceInfoText,
'tvbPackage' : tvbPackage,
'dateFrom' : fromDate,
'moreRoomRows' : false
}) }}
{% endif %}
<div id="room-row-collapse-parent-{{ product.getProductId() }}">
<div class="panel">
{% if not availabilityIsChecked or not hasSingleRoomRow %}
{{ include("@ElementsDemiFrontend/Includes/teaser/room-details.html.twig", {
"id" : product.getProductId(),
"accommodationProduct" : accommodationProduct,
"images" : images,
"availabilityIsChecked" : availabilityIsChecked,
"moreRoomRows" : not hasSingleRoomRow ? moreRoomRows : '',
"accommodation" : accommodation,
"dateFrom" : fromDate,
"pakcage" : tvbPackage
}) }}
{% endif %}
{% if availabilityIsChecked %}
{% for productIndex, product in productData.products %}
{{ include("@ElementsDemiFrontend/Includes/teaser/room-teaser-content.desktop.html.twig", {
"count" : productIndex,
"product" : product,
"productData" : productData,
"images" : images,
"tableOnSide" : false,
"hasSingleRoomRow" : hasSingleRoomRow,
"availabilityIsChecked" : availabilityIsChecked,
"moreRoomRows" : not hasSingleRoomRow ? moreRoomRows : null,
'tvbPackage' : tvbPackage,
'dateFrom' : fromDate,
}) }}
{% if hasSingleRoomRow %}
{{ include("@ElementsDemiFrontend/Includes/teaser/room-details.html.twig", {
'id' : product.getProductId(),
"accommodationProduct" : accommodationProduct,
"images" : images,
"availabilityIsChecked" : availabilityIsChecked,
"moreRoomRows" : null,
"dateFrom" : fromDate,
"package" : tvbPackage
}) }}
{% endif %}
{% endfor %}
{% elseif showAvailablityCalendar %}
{{ include("@ElementsDemiFrontend/Includes/teaser/room-availabilities.html.twig", {
'product' : accommodationProduct,
"accommodation" : accommodation
}) }}
{% endif %}
</div>
</div>
</div>
</div>
</li>
{% endif %}
{% endif %}