src/Elements/Bundle/DemiFrontendBundle/Resources/views/Accommodation/searchInfoBox.mobile.html.twig line 1

Open in your IDE?
  1. {% set isDestinationPackage = isDestinationPackage is defined ? isDestinationPackage : false %}
  2. {% set minPrice=0 %}
  3. {% if accommodationResultSet is defined and accommodationResultSet is not null and accommodationResultSet != false %}
  4.     {% if accommodationResultSet is iterable %}
  5.         {% set accommodationResultSet = accommodationResultSet|first %}
  6.     {% endif %}
  7.     {% if accommodationResultSet is not null and accommodationResultSet is not empty %}
  8.         {% set minPrice = accommodationResultSet.getMinPrice() is not empty ? accommodationResultSet.getMinPrice() : accommodationResultSet.getMinPriceBase() %}
  9.         {% set minPriceProductId = accommodationResultSet.getMinPriceProductId()[0] is not empty ? accommodationResultSet.getMinPriceProductId()[0] : accommodationResultSet.getMinPriceBaseProductId() %}
  10.         {% set minPriceProduct = pimcore_object(minPriceProductId) %}
  11.     {% endif %}
  12. {% else %}
  13.     {% set minPriceProduct = null %}
  14. {% endif %}
  15. <script data-cookieconsent="ignore">
  16.     _config.openTabAndSroll = true;
  17. </script>
  18. <div>
  19.     <div class="row align-items-baseline">
  20.         {% if accommodationResultSet is defined and accommodationResultSet is not null and  accommodationResultSet is not empty and accommodationResultSet.getMinPrice() is not empty  and  minPrice > 0 %} {#only show if search #}
  21.             {% set minPriceBeforeSpecial =  demi_getMinPriceBeforeSpecial(accommodationResultSet) %}
  22.             {% if minPriceBeforeSpecial != false %}
  23.                     <div class="col col-auto text-muted">
  24.                         <div class="sr-only">{{ "demi.detail.instead-of"|trans }}</div>
  25.                         <s>{{ demi_paymentGetPriceObject(minPriceBeforeSpecial, pimcore_object(accommodationResultSet.getAccommodationId()))}}</s>
  26.                     </div>
  27.             {% endif %}
  28.             <div class="col text-right">
  29.                 <strong class="font-medium fz17 text-success">{{ 'demi.price-from-short'|trans }} {{ demi_paymentGetPriceObject(minPrice, pimcore_object(accommodationResultSet.getAccommodationId()))}}</strong>
  30.             </div>
  31.         {% endif %}
  32.     </div>
  33.     <div class="mt-3">
  34.         {% if minPriceProduct is not null and minPriceProduct.getProductType()=="Package" and not isPackage %}
  35.             {% set href = "packages" %}
  36.         {% elseif isPackage %}
  37.             {% set href = "booking" %}
  38.         {% else %}
  39.             {% set href = "rooms" %}
  40.         {% endif %}
  41.         {% if accommodationResultSet is not null and accommodationResultSet is not empty and accommodationResultSet.getMinPrice() is not empty and accommodationResultSet.getMinPrice() > 0 %}
  42.             {% if accommodationResultSet.getActualBookable(true) %}
  43.             <a href="#{{ href }}"
  44.                data-target="#{{ href }}"
  45.                aria-controls="{{ href }}"
  46.                class="btn btn-success btn-block btn-lg js-open-tab-and-scroll js-tracking--click"
  47.                data-tracking-category="{{ isPackage ? 'Package detail': 'Accommodation detail'}}"
  48.                data-tracking-action="click booking top"
  49.             >
  50.                 <span class="btn__icon demi-icon demi-icon-cart mr-2" aria-hidden="true"></span>
  51.                 {{ "demi.detail.booking-button"|trans }}
  52.             </a>
  53.             <div class="mt-2 text-center text-success small">
  54.                 {{ "demi.detail.promote-booking-speed"|trans }}
  55.             </div>
  56.             {% endif %}
  57.         {% elseif accommodationResultSet is not empty or isDestinationPackage and not document.property("demi_hideVacancySearch") %}
  58.             <button type="button" class="btn btn-success btn-block btn-lg js-overlay__toggle my-3"
  59.                     data-target="#search-overlay">
  60.                 {{ 'demi.detail.search-vacancies-button'|trans }}
  61.             </button>
  62.         {% endif %}
  63.     </div>
  64. </div>