src/Elements/Bundle/DemiFrontendBundle/Resources/views/Accommodation/includes/package-details.desktop.html.twig line 1

Open in your IDE?
  1. {% set descriptionTypeMapping = {
  2.     0: "Package",
  3.     1: "PackageContentShort",
  4.     2: "PackageContentLong",
  5.     3: "PackageShortText"
  6. } %}
  7. {% if tvbPackage is defined %}
  8.     {% set package = tvbPackage %}
  9.     {% set descriptionTypeMapping = {
  10.         0: "Package",
  11.         2: "PackageContentLong"
  12.     } %}
  13. {% else %}
  14.     {% set package = housePackageMaster %}
  15.     {% set tvbPackage = null %}
  16. {% endif %}
  17. <section class="{{ fromTvbOverview is defined and fromTvbOverview == true ? '' : 'mt-4' }}"
  18.          data-track-content
  19.          data-content-name="package-info">
  20.     <div class="wysiwyg">
  21.         <div class="row">
  22.             <div class="col-8">
  23.                 {% if fromTvbOverview is defined and fromTvbOverview %}
  24.                     <h2 class="mb-4 text-primary">{{ "demi.detail.package.tab.package"|trans }}</h2>
  25.                 {% endif %}
  26.                 {% for type in  descriptionTypeMapping %}
  27.                     {% set text = package.getDescription(type,app.request.locale,dateFrom is defined ? dateFrom : null) %}
  28.                     {% if text is empty and searchParam is defined %}
  29.                         {% set text = package.getDescription(type, demi_core_configuration('getFallbackLanguage', []), searchParam is defined ? searchParam.getDateFrom() : null) %}
  30.                     {% endif %}
  31.                     {% if text is not empty %}
  32.                         {{ text|raw }}<br/><br/>
  33.                     {% endif %}
  34.                 {% endfor %}
  35.             </div>
  36.             <div class="col-4 border-left">
  37.                 <section class="mt-3">
  38.                     <div class="h5 mb-1">{{ 'demi.detail.package.validdates'|trans }}</div>
  39.                     {% set validDates = package.getValidDates() %}
  40.                     {% if validDates is not null %}
  41.                         {% if not tvbPackage is null and tvbPackage.getClassName() == 'demiPackage' %}
  42.                             {% for item in validDates.getItems() %}
  43.                                 {% if item.getDateTo() > date('now') %}
  44.                                     {{ elements_dateFormatRange(item.getDateFrom(),item.getDateTo(),'daterange-short-long', 'daterange-long-long') }}
  45.                                     <br/>
  46.                                 {% endif %}
  47.                             {% endfor %}
  48.                         {% else %}
  49.                             {% for item in validDates.getItems() %}
  50.                                 {% if item.getTo() > date('now') %}
  51.                                     {{ elements_dateFormatRange(item.getFrom(),item.getTo(),'daterange-short-long', 'daterange-long-long') }}
  52.                                     <br/>
  53.                                 {% endif %}
  54.                             {% endfor %}
  55.                         {% endif %}
  56.                     {% endif %}
  57.                 </section>
  58.                 {% if not tvbPackage is null and tvbPackage is instanceof('\\Elements\\Demi\\Model\\Package') and not tvbPackage.hasAccommodationSection() %}
  59.                     <script>
  60.                         _config.overlay = true;
  61.                     </script>
  62.                     <div class="mt-3">
  63.                         {% if not tvbPackage is null and tvbPackage.getCheapestPackagePrice() %}
  64.                             <strong class="font-medium offer-box__price text-success">
  65.                                 {{ 'demi.price-from-short'|trans }} {{ demi_paymentGetPriceObject(tvbPackage.getCheapestPackagePrice()) }}
  66.                             </strong><br/>
  67.                         {% endif %}
  68.                         {% set addToCartUrl = demi_demiUrl({
  69.                             'path': demi_core_configuration('getCheckoutPath',[]).getFullPath(),
  70.                             'controller': 'cart',
  71.                             'action': 'packagestep1'
  72.                         }, 'demi_checkout', true) %}
  73.                         <script>
  74.                             _config.addPackageToCart = true;
  75.                             _config.addToCartUrl = "{{ addToCartUrl }}";
  76.                             _config.packageId = "{{ tvbPackage.getId() }}";
  77.                         </script>
  78.                         <div class="mt-3">
  79.                             <button type="button" class="btn btn-success js-overlay__toggle js-add-package-to-cart__btn"
  80.                                     data-target="#search-overlay">
  81.                                 {{ 'demi.detail.package.add-to-cart'|trans }}
  82.                                 <span class="circle-spinner circle-spinner--white circle-spinner--small ml-2 js-add-package-to-cart__loading"
  83.                                       aria-label="{{ 'demi.content-loading'|trans }}"
  84.                                       title="{{ 'demi.content-loading'|trans }}" hidden>
  85.                                 </span>
  86.                             </button>
  87.                             <div class="js-add-package-to-cart__error text-danger mt-3 strong" role="alert" hidden>
  88.                                 <div class="row row--gutter-width-6">
  89.                                     <div class="col-auto">
  90.                                     <span class="demi-icon demi-icon-warning icon-in-text"
  91.                                           title="{{ 'demi.warning'|trans }}"
  92.                                           aria-label="{{ 'demi.warning'|trans }}"/>
  93.                                     </div>
  94.                                     <div class="col js-add-package-to-cart__error-text"></div>
  95.                                 </div>
  96.                             </div>
  97.                             <div class="js-add-package-to-cart__warning text-warning mt-3 strong" role="alert" hidden>
  98.                                 <div class="row row--gutter-width-6">
  99.                                     <div class="col-auto">
  100.                                     <span class="demi-icon demi-icon-warning icon-in-text"
  101.                                           title="{{ 'demi.warning'|trans }}"
  102.                                           aria-label="{{ 'demi.warning'|trans }}"/>
  103.                                     </div>
  104.                                     <div class="col js-add-package-to-cart__warning-text"></div>
  105.                                 </div>
  106.                             </div>
  107.                         </div>
  108.                         {% else %}
  109.                         {% if not tvbPackage is null and tvbPackage is instanceof('\\Elements\\Demi\\Model\\Package') %}
  110.                             {{ include('@ElementsDemiFrontend/DestinationPackage/includes/destinationpackageBookingInfos.html.twig',{
  111.                                 'tvbPackage': tvbPackage
  112.                             }) }}
  113.                         {% endif %}
  114.                         {% if isAffiliate is not defined or isAffiliate == false %}
  115.                         {% set tvbPackageListUrl = null %}
  116.                         {% if accommodation is not defined and not tvbPackage is null %}
  117.                             {% if tvbPackage.getClassName() == 'demiPackage' %}
  118.                                 {% set tvbPackageListDocument = demi_findDestinationPackageAccoList(document, tvbPackage) %}
  119.                             {% elseif tvbPackage.getClassName() == 'demiHousePackageMaster' %}
  120.                                 {% set tvbPackageListDocument = demi_findHousePackageMasterSelfAssignList(document, tvbPackage) %}
  121.                             {% elseif tvbPackage.getClassName() == "demiHousePackageContainer" %}
  122.                                 {% set tvbPackageListDocument = demi_findHousePackageContainerList(document, tvbPackage) %}
  123.                             {% endif %}
  124.                             {% if tvbPackageListDocument is defined and tvbPackageListDocument %}
  125.                                 {% set tvbPackageListUrl = tvbPackageListDocument.getFullPath() %}
  126.                             {% endif %}
  127.                         {% endif %}
  128.                         <div class="mt-3 js-search-data__hide-if-submitted" {{ availabilityIsChecked is defined and availabilityIsChecked ==true ? 'hidden' : '' }}>
  129.                         {% if tvbPackageListUrl is not null %}
  130.                             {% if not tvbPackage is null and tvbPackage.getCheapestPackagePrice() is not empty %}
  131.                                 <strong class="font-medium offer-box__price text-success">
  132.                                     {{ 'demi.price-from-short'|trans }} {{ demi_paymentGetPriceObject(tvbPackage.getCheapestPackagePrice()) }}
  133.                                 </strong><br/>
  134.                             {% endif %}
  135.                             <a href="{{ tvbPackageListUrl }}"
  136.                                data-target="#booking"
  137.                                aria-controls="booking"
  138.                                class="btn btn-success btn-lg">
  139.                                 <script data-cookieconsent="ignore">
  140.                                     _config.openTabAndSroll = true;
  141.                                 </script>
  142.                                 <span class="btn__icon demi-icon demi-icon-cart mr-2" aria-hidden="true"></span>
  143.                                 {{ "demi.detail.package.booking-button"|trans }}
  144.                             </a>
  145.                         {% elseif fromTvbOverview is defined and fromTvbOverview %}
  146.                             <div class="text-danger"> {{ 'demi.destinationpackage.not-bookable'|trans }} </div>
  147.                         {% endif %}
  148.                     </div>
  149.                 {% endif %}
  150.                 {% endif %}
  151.             </div>
  152.         </div>
  153.     </div>
  154. </section>
  155. <hr class="hr--border-gray my-5">
  156. {% if not tvbPackage is null and tvbPackage.getClassName() == 'demiPackage' and not tvbPackage.hasAccommodationSection() %}
  157.     {{ include('@ElementsDemiFrontend/Includes/overlays/search.html.twig',{
  158.         'searchParam': searchParam is defined ? searchParam : null,
  159.         'isSearch': true,
  160.         'modifierClass': isAffiliate is defined and isAffiliate == true ? 'overlay--centered-top' : 'overlay--centered'
  161.     }) }}
  162. {% endif %}