src/Elements/Bundle/DemiFrontendBundle/Resources/views/Accommodation/searchInfoBoxCompact.desktop.html.twig line 1

Open in your IDE?
  1. {% set productSets = accommodationResultSet is not empty ? accommodationResultSet.getMinPriceProductSets() : [] %}
  2. {% set isCorridor = isCorridor is defined ? isCorridor : false %}
  3. {% if tvbPackage is defined %}
  4.     {% set productSets = [productResultSet] %}
  5. {% endif %}
  6. {% if productSets is not defined or productSets is empty %}
  7.     {% set productSets = (productResultSet is defined and productResultSet is not empty and productResultSet.getProducts() is not null) ? productResultSet.getProducts() : [] %}
  8.     {% if packages is defined and packages is not null %}
  9.         {% set packageSets = [] %}
  10.         {% set minPrice = 0 %}
  11.         {% for hpm in packages %}
  12.             {% set packageSets = packageSets + (hpm.getRoomRows()|first).getProducts() %}
  13.         {% endfor %}
  14.         {# Cheapest product if there are packages but no rooms (no accommodationResultSet) #}
  15.         {% set cp = demi_getMinPriceOfHousePackageMasterResultSet(packageSets)["cP"] %}
  16.         {% set productSets = productSets + packageSets %}
  17.     {% elseif accommodationResultSet is instanceof('\\Elements\\Demi\\Accommodation\\Search\\ResultSet\\HousePackageMaster') %}
  18.         {# Cheapest product (no minPrice and package site) #}
  19.         {% set cp = demi_getMinPriceOfHousePackageMasterResultSet(accommodationResultSet)["cP"] %}
  20.     {% endif %}
  21.     {% if accommodationResultSet is defined and accommodationResultSet is not null and accommodationResultSet.getMinPriceBaseProductId() %}
  22.         {% set minId = accommodationResultSet.getMinPriceBaseProductId() %}
  23.         {% set productSets = productSets[minId] is defined ? [productSets[minId]] : [] %}
  24.     {% elseif availabilityIsChecked is defined and not availabilityIsChecked %}
  25.         {% if cp is defined and cp is not empty %}
  26.             {% set productSets =  [cp] %}
  27.         {% endif %}
  28.     {% endif %}
  29. {% endif %}
  30. {% if accommodationResultSet is defined and accommodationResultSet is not null %}
  31.     {% set accommodation = pimcore_object(accommodationResultSet.getAccommodationId()) %}
  32. {% endif %}
  33. {% set href = "rooms" %}
  34. {% if isPackage is defined and isPackage == true %}
  35.     {% set href = "booking" %}
  36. {% endif %}
  37. {% if accommodationResultSet is defined and accommodationResultSet is not null and  accommodationResultSet.getRoomRows()|length < productSets|length  %}
  38.     {% set productSets = productSets|slice(0,accommodationResultSet.getRoomRows()|length) %}
  39. {% endif %}
  40.     {% if productSets is defined and  productSets is not empty and  (productSets|first) is not null %}
  41.         {% set rowCounter=0 %}
  42.         {% for productSet in productSets %}
  43.             {% set accommodationProduct = pimcore_object(productSet.getProductId())  %}
  44.             {% set mealObj = demi_getMealTypeByFid(productSet.getMealCode() ?? '') %}
  45.             {% if accommodationResultSet is not empty and accommodationResultSet.getRoomRows()[rowCounter] is not empty %}
  46.                 {% set roomRow = accommodationResultSet.getRoomRows()[rowCounter].getRowObject() ?: null %}
  47.             {% endif %}
  48.             {% if mealObj is defined and mealObj is not null %}
  49.             <div class="small text-nowrap">
  50.                 <div class="demi-icon demi-icon-restaurant mr-1 icon-in-text" aria-label="{{ 'demi.detail.room.meals'|trans }}" title="{{ "demi.detail.room.meals"|trans }}"></div>
  51.                 {{ mealObj.getText() }}
  52.             </div>
  53.             {% endif %}
  54.             {% set price = productSet.getPrice()?: productSet.getBasePrice() %}
  55.             {% if price > 0 %}
  56.                 <strong class="font-medium offer-box__price text-success">{{ 'demi.price-from-short'|trans }} {{ demi_paymentGetPriceObject(price, accommodation) }}</strong>
  57.             {% endif %}
  58.         {% set rowCounter = rowCounter +1 %}
  59.         {%  if rowCounter == productSets|length %}
  60.             {% if roomRow is defined and  roomRow is not empty %}
  61.             <a href="#{{ href }}"
  62.                data-target="#{{ href }}"
  63.                aria-controls="{{ href }}"
  64.                class="btn btn-success btn-block btn-lg js-open-tab-and-scroll">
  65.                 <script data-cookieconsent="ignore">
  66.                     _config.openTabAndSroll = true;
  67.                 </script>
  68.                 {{ "demi.detail.show-offer"|trans }}<span class="demi-icon demi-icon-arrow-right btn__icon ml-2" aria-hidden="true"></span>
  69.             </a>
  70.             {% elseif demi_accoBookableOrOfferable(accommodation, accommodationResultSet,demi_core_configuration("getDisableEnquiry",[])) %}
  71.                 <button type="button" class="btn btn-success btn-block btn-lg js-overlay__toggle" data-target="#search-overlay">
  72.                     {{ "demi.list.search-vacancies-button"|trans }}
  73.             {% endif %}
  74.             <div class="mt-2 text-center text-primary js-search-data__hide-if-submitted" {{ roomRow is defined and roomRow is not empty ? 'hidden' : '' }}>
  75.                 <a class="js-open-tab-and-scroll" href="#{{ href }}">
  76.                     <span class="demi-icon demi-icon-arrow-right btn__icon mr-1" aria-hidden="true"></span>{{ "demi.detail.show-all"|trans }} {{ demi_getRoomsTabTranslationKey(accommodation)|trans }}
  77.                 </a>
  78.             </div>
  79.         {% else %}
  80.            <hr class="hr--border-gray my-4">
  81.         {% endif %}
  82.         {% endfor %}
  83.     {% else %}
  84.         {% if isCorridor  is defined and isCorridor == true %}
  85.             <div>
  86.                 {% if alternativeResultSet is not defined or alternativeResultSet is null %}
  87.                     <div class="wysiwyg">
  88.                         {{ "demi.detail.corridormatrix.choose-date-and-nights"|trans }}
  89.                     </div>
  90.                 {% endif %}
  91.                     <a href="#{{ href }}"
  92.                        data-target="#{{ href }}"
  93.                        aria-controls="{{ href }}"
  94.                        data-tracking-category="Accommodation detail"
  95.                        data-tracking-category="click booking search info"
  96.                        class="btn btn-success btn-block btn-lg js-open-tab-and-scroll mt-2 js-tracking--click">
  97.                         {{ 'demi.detail.show-offers-corridor'|trans }}
  98.                     </a>
  99.             </div>
  100.         {% else %}
  101.             <div>
  102.                 <div class="wysiwyg">
  103.                     {{ 'demi.detail.no-rooms'|trans }}
  104.                 </div>
  105.                 <button type="button" class="btn btn-success js-overlay__toggle" data-target="#search-overlay">
  106.                     {{ "demi.search.change"|trans }}
  107.                 </button>
  108.             </div>
  109.         {% endif %}
  110.     {% endif %}
  111. {% if useCancellationInfo is defined and productSet is defined and productset is not empty and productSet.getCancellationInformation() is not empty %}
  112.     {% set cancellationInformation = productSet.getCancellationInformation() %}
  113.     {% set displayInfo = demi_getCancellationDisplayInfo(cancellationInformation,fromDate) %}
  114.     {% set freeCancelText = displayInfo.getFreeCancellationText() %}
  115.     {% set freeCancelText = freeCancelText == ""  ? null : 'demi.list.free-cancellation'|trans %}
  116. {% endif %}
  117. {% if freeCancelText is defined %}
  118.     <div class="text-success small text-center mt-2">
  119.         {{ freeCancelText }}
  120.     </div>
  121. {% endif %}