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

Open in your IDE?
  1. {% if not availabilityIsChecked %}
  2.     {% set fromDate = null %}
  3. {% else %}
  4.     {% set fromDate = demi_getSearchFrom() %}
  5. {% endif %}
  6. {% if not editmode %}
  7.     {% do elements_head_title().setTitle( demi_seoTitleForHousePackage(accommodation,housePackageMaster,null), true ) %}
  8.     {% do elements_head_meta().setDescription( demi_seoDescriptionForHousePackage(accommodation,housePackageMaster,null,fromDate),true )  %}
  9. {% endif %}
  10. {% set canonicalUrl = linkGenerator().generate(housePackageMaster) %}
  11. {% do elements_canonical().checkAllParams(false).setDomain(canonicalUrl)|raw %}
  12. {% set deactivateHrefland = true %}
  13. {%  do demi_paymentGetDefaultCurrency(accommodation) %}
  14. {% set address = accommodation.getAddress() %}
  15. {% set maxRatingValue = demi_core_configuration('getMaxRatingValue',[]) ?: 5 %}
  16. {% set maxRatingNormalized = demi_core_configuration('getMaxRatingNormalized',[]) ?: 5 %}
  17. {% set hasRatingWidget = demi_ratingGetHasRatingWidgetTrustYou(accommodation) %}
  18. {% set accoUrlPlain = demi_demiUrl({
  19.     'accommodation': accommodation
  20. },'demi_acco_detail_page',true) %}
  21. {% set accoUrl = accoUrlPlain %}
  22. {% if "?" in accoUrl %}
  23.     {% set accoUrl = accoUrl ~ "&activeTab=%23packages" %}
  24. {% else  %}
  25.     {% set accoUrl = accoUrl ~ "?activeTab=%23packages" %}
  26. {% endif %}
  27. {% set housePackageResultSet = housePackageResultSet|length ? housePackageResultSet[0] : null %}
  28. {% set ajaxUrl = demi_demiUrl({
  29.     'accommodation': accommodation,
  30.     'package': housePackageMaster
  31. },'demi_acco_package_ajax') %}
  32. {% if  '?' in ajaxUrl %}
  33.     {% set parts = ajaxUrl|split('?') %}
  34.     {% set ajaxUrl = parts[0] %}
  35. {% endif %}
  36. {% set liveDetailProductsUrl = ajaxUrl ~ "?ajaxRequestType=getLiveDetailProducts" %}
  37. {% set corridorMatrixUrl = ajaxUrl ~ "?ajaxRequestType=getCorridorMatrix" %}
  38. {% set productUrl = ajaxUrl ~ "?ajaxRequestType=getProductByIdAndMealcode" %}
  39. {% set paymentInformationUrl = ajaxUrl ~ "?ajaxRequestType=getProductByIdAndMealcode" %}
  40. {% set step1Url = demi_demiUrl({
  41.     'path': demi_core_configuration('getCheckoutPath',[]).getFullPath(),
  42.     'controller': 'cart',
  43.     'action': 'step1'
  44. },'demi_checkout',true) %}
  45. {% set anchors = {
  46.     'details': '#details',
  47.     'booking': '#booking',
  48.     'pictures': '#pictures',
  49.     'rating': '#ratings'
  50. } %}
  51. {% if activeTab is not defined or activeTab not in anchors %}
  52.     {% set activeTab = '#details' %}
  53. {% else %}
  54.     {% do jsConfig('_initialState').add({'activeTab': activeTab}) %}
  55. {% endif %}
  56. {% set imagesTypes = demi_getAccoImagesTypesAsArray(housePackageMaster) %}
  57. {% set imageList = housePackageMaster.getImages(null, fromDate, true) %}
  58. {% set imageList = imageList|merge(accommodation.getImages(imagesTypes, fromDate, true)) %}
  59. {% if imageList is not empty %}
  60.     {% do elements_opengraph().addImage(imageList[0].getThumbnail('slider-main').getPath()) %}
  61. {% endif %}
  62. {% set photoCount = imageList|length %}
  63. {% set videoCount = impressionLinks["video"]|length %}
  64. {% set panoCount = impressionLinks["pano"]|length %}
  65. {% if showJsonLd %}
  66.     {% set jsonLdData = demi_getProductJsonLdData(accommodation, housePackageResultSet, housePackageMaster, fromDate, []) %}
  67.     {% do jsonLd().add("accommodation", jsonLdData) %}
  68.     {# TODO @msteyrer breadcrumb helper bundle not in use atm
  69.     {% do breadcrumbHelper().set({
  70.         'parentId': document.getId(),
  71.         'url': accoUrlPlain,
  72.         'label': accommodation.getName()
  73.     }) %}
  74.     {% do breadcrumbHelper().append({
  75.         'parentId': document.getId(),
  76.         'url': canonicalUrl,
  77.         'label': housePackageMaster.getName()
  78.     }) %}
  79.      {{ include('@ElementsDemiFrontend/Navigation/breadcrumb.html.twig') }} #}
  80. {% endif %}
  81. {% set headerName = "full" %}
  82. {% set width = 0 %}
  83. {% set forceMultiHeader = accommodation.getForceMultiHeader() %}
  84. {% if imageList is defined and imageList|length > 0 and imageList[0] is not empty  %}
  85.     {% set width = imageList[0].getCustomSettings()["imageWidth"] %}
  86.     {% do elements_opengraph().addImage(imageList[0].getFullPath()) %}
  87. {% endif %}
  88. {% if width < demi_core_configuration("getMinWidthForFullHeader",[]) or forceMultiHeader %}
  89.     {% set headerName = "multi-image" %}
  90. {% endif %}
  91. {% if not canonicalUrl is same as(app.request.pathInfo) %}
  92.  {% do elements_robots().setNoIndex(true) %}
  93. {% endif %}
  94. {% extends '@ElementsDemiFrontend/Layout/layout.html.twig' %}
  95. {% block content %}
  96.     {{  include("@ElementsDemiFrontend/Includes/canonicalOverride.html.twig", {
  97.         "object": accommodation,
  98.         "package": housePackageMaster
  99.     }) }}
  100. <script type="text/javascript" data-cookieconsent="ignore">
  101.     _config.viewType = "package";
  102.     _config.historyController = true;
  103.     _config.roomSelection = true;
  104.     _config.searchData = true;
  105.     _config.detailResultUrl = '{{ liveDetailProductsUrl|raw }}';
  106.     _config.corridorSearchUrl = '{{ corridorMatrixUrl|raw }}';
  107.     _config.detailPaymentInfoUrl = '{{ paymentInformationUrl|raw }}';
  108.     _config.detailProductUrl = '{{ productUrl|raw }}';
  109.     _config.addToCartUrl = '{{ step1Url|raw }}';
  110.     _config.cartWarningOnMultipleAccoProducts = {{  demi_core_configuration('getWarningOnMultipleAccoProducts',[]) ? 'true': 'false' }};
  111.     _config.cartInfoUrl = '{{ demi_checkoutUrl('cart','hasAccoInCart')|raw }}';
  112.     _config.roomList = true;
  113.     _config.hpmId = "{{ housePackageMaster.getId() }}";
  114.     _config.trackingCountingClicksUrl='{{ countingClicksUriJs|raw }}';
  115.     _config.productData = {
  116.         id: {{ accommodation.getId() }},
  117.         name: "{{ demi_impressionName(accommodation) }}",
  118.         category: "{{ demi_impressionCategory(accommodation, housePackageMaster, searchParam) }}",
  119.         brand: "{{ demi_impressionBrand(accommodation) }}"
  120.     };
  121.     {#_config.productData = {#}
  122.     {#    id: {{ accommodation.getId() }},#}
  123.     {#    name: "{{ demi_impressionName(accommodation) }}",#}
  124.     {#    category: "{{ demi_impressionCategory(accommodation, housePackageMaster, searchParam, null) }}",#}
  125.     {#    brand: "{{ demi_impressionBrand(accommodation) }}"#}
  126.     {#};#}
  127.     _config.acommodationMapHideBusinesses = {{ demi_core_configuration('getMapHideBusinesses',[]) ? 'true' : 'false' }};
  128.     {% set mealtypeId = searchParam.getMealTypeId()   %}
  129.     {% if mealtypeId is not empty and mealtypeId[0] is not empty %}
  130.     _config.urlParams = _config.urlParams || [];
  131.     _config.urlParams.push( { name : "mealtype", value : "{{ mealtypeId[0] }}"} );
  132.     {% endif %}
  133.     {% if searchParam.getBookOnly() %}
  134.     _config.urlParams = _config.urlParams || [];
  135.     _config.urlParams.push( { name : "bookonly", value : "on"} );
  136.     {% endif %}
  137. </script>
  138.     {{ include('@ElementsDemiFrontend/Includes/tags/detail-package.html.twig',
  139.         {
  140.             'isMobile': false,
  141.             'acco': accommodation,
  142.             'searchParam': searchParam,
  143.             'accoResultSet': accommodationResultSet is defined ? accommodationResultSet : null ,
  144.             'productResultSet': productResultSet is defined ? productResultSet : null,
  145.             'packages': packages is defined ? packages : null,
  146.             'sortedMarketingGroups': sortedMarketingGroups,
  147.             'sortedFacilities': sortedFacilities,
  148.             'sortedHealthMeasures':sortedHealthMeasures,
  149.             'photoCount': photoCount,
  150.             'videoCount': videoCount,
  151.             'panoCount': panoCount,
  152.             'housePackageResultSet': housePackageResultSet,
  153.             'housePackageMaster': housePackageMaster
  154.         }
  155.     ) }}
  156. <main id="main" role="main">
  157.     <div hidden>
  158.         {{ include('@ElementsDemiFrontend/Accommodation/lightboxTopbar.html.twig') }}
  159.     </div>
  160.     {% set heroImageAlt = 'Package ' ~ housePackageMaster.getName() ~ ' - ' ~ accommodation.name %}
  161.     {% if imageList|length >= 3  or headerName=="full" %}
  162.         {{ include('@ElementsDemiFrontend/Accommodation/includes/acco-header-' ~ headerName ~'.desktop.html.twig',
  163.             {
  164.                 'photoCount': photoCount,
  165.                 'videoCount': videoCount,
  166.                 'panoCount': panoCount,
  167.                 'imageList': imageList,
  168.                 'alt': heroImageAlt
  169.             }
  170.         ) }}
  171.     {% endif %}
  172.     {{ include('@ElementsDemiFrontend/Includes/elements/search-info.desktop.html.twig', { "searchParam": searchParam, "availabilityIsChecked": availabilityIsChecked, "isSearch": false}) }}
  173.     <div class="container mt-5">
  174.         <div class="row">
  175.             <div class="col-xl-9 col-12">
  176.                 <div class="row mb-5">
  177.                     <div class="col">
  178.                         {% if accommodation.getIsTesthotel() %}
  179.                         <div class="demi-test-acco-notice mb-3 text-danger"><strong>Testbetrieb</strong> nur für Debug/aktive Pimcore User sichtbar</div>
  180.                         {% endif %}
  181.                         <h1 class="text-primary">{{ housePackageMaster.getName() }}</h1>
  182.                         <h2 class="mb-0">
  183.                             <a class="js-tracking--click-piwik"
  184.                                href="{{ accoUrlPlain }}"
  185.                                data-tracking-category="Package detail"
  186.                                data-tracking-action="accomoation click">
  187.                                 {{ demi_getAccoNameWithStars(accommodation) }}
  188.                             </a>
  189.                         </h2>
  190.                         <a href="{{ accoUrl }}"
  191.                            class="mb-3 d-block text-primary js-tracking--click-piwik"
  192.                            data-tracking-category="Package detail"
  193.                            data-tracking-action="all packages click">
  194.                             {{ "demi.detail.package.show-all-offers-of-acco"|trans }}
  195.                         </a>
  196.                         <div class="row mb-2">
  197.                             <div class="col col-auto">
  198.                                 {{ accommodation.getCategoryNames(2) }}
  199.                             </div>
  200.                             <div class="col col-auto">
  201.                                 <div class="media text-muted">
  202.                                     {% if address is not empty and address.getTown() is not empty  %}
  203.                                     <div class="demi-icon demi-icon-marker mr-1 icon-in-text" title="{{ 'demi.detail.town'|trans }}" aria-label="{{ 'demi.detail.town'|trans }}"></div>
  204.                                     <div class="media-body">
  205.                                         {{ address.getTown() }}
  206.                                     </div>
  207.                                     {% endif %}
  208.                                 </div>
  209.                             </div>
  210.                             <div class="col col-auto">
  211.                                 {% if distance is defined and distance is not empty %}
  212.                                     <div class="media text-muted">
  213.                                         <span class="badge badge-primary mr-1">{{ distance['value'] }}</span>
  214.                                         <div class="media-body">
  215.                                             <span class="text-primary">{{ distance['from'] }}</span>
  216.                                         </div>
  217.                                     </div>
  218.                                 {% endif %}
  219.                             </div>
  220.                         </div>
  221.                     </div>
  222.                     <div class="col col-auto">
  223.                         <div class="mb-4">
  224.                             {{ include('@ElementsDemiFrontend/Accommodation/includes/serviceprovider-logo.html.twig', {
  225.                                 "logo": accommodation.getImages([constant('Elements\\Demi\\Deskline\\Constant\\DocumentInterface::DOCUMENT_TYPE_SERVICE_PROVIDER_LOGO')])|first
  226.                             }) }}
  227.                         </div>
  228.                         <div>
  229.                             {% if accommodation.getRatingSystem()=="TrustYou" %}
  230.                                 {% set normalizedRating = demi_ratingGetNormalized(accommodation, maxRatingValue, maxRatingNormalized) %}
  231.                                 {% if normalizedRating is not empty %}
  232.                                     {{ include('@ElementsDemiFrontend/Accommodation/includes/rating-md.html.twig', {
  233.                                         "score": normalizedRating,
  234.                                         "text": accommodation.getRatingScoreDescription(),
  235.                                         "styleModifier": "mb-1",
  236.                                         "showReviewCount": true,
  237.                                         "ratingCount": accommodation.getRatingCountDirect(),
  238.                                         "isTextWhite" : false
  239.                                     }) }}
  240.                                 {% endif %}
  241.                             {% endif %}
  242.                         </div>
  243.                     </div>
  244.                     <div class="col col-auto">
  245.                         <div class="row">
  246.                             <div class="col col-auto d-xl-none d-md-block">
  247.                                 <div class="ml-3" aria-live="polite">
  248.                                     <div class="js-room-list__loading js-corridor__search-info-loading--compact" hidden>
  249.                                         <div class="text-center py-3">
  250.                                             {{ include('@ElementsDemiFrontend/Includes/elements/spinner/loading-spinner.html.twig') }}
  251.                                         </div>
  252.                                     </div>
  253.                                     <div class="js-room-list__content js-corridor__search-info-content--compact" data-list="searchInfoCompact">
  254.                                         {{ include('@ElementsDemiFrontend/Accommodation/searchInfoBoxCompact.desktop.html.twig', {
  255.                                             "accommodationResultSet": accommodationResultSet is defined ? accommodatonReslutSet : null,
  256.                                             "productResultSet": productResultSet is defined ? productResultSet : null,
  257.                                             "accommodation": accommodation,
  258.                                         }) }}
  259.                                     </div>
  260.                                 </div>
  261.                             </div>
  262.                         </div>
  263.                     </div>
  264.                 </div>
  265.                 <script data-cookieconsent="ignore">
  266.                     _config.paramTabs = true;
  267.                     _config.loadAccoImages = true;
  268.                 </script>
  269.                 <div class="mt-3">
  270.                     <ul class="nav nav-border-tabs" role="tablist">
  271.                         <li class="nav-item">
  272.                             <a class="nav-link js-param-tab{{ activeTab == anchors['details'] ? ' active' : '' }} js-tracking js-tracking--click"
  273.                                href="{{ anchors['details'] }}"
  274.                                data-toggle="tab"
  275.                                role="tab"
  276.                                aria-expanded="{{ activeTab == anchors['details'] ? 'true' : 'false' }}"
  277.                                data-tracking-category="button"
  278.                                data-tracking-action="package-details"
  279.                                data-tracking-label="{{ accommodation.getName()|escape }}">
  280.                                 {{ "demi.detail.package.tab.package"|trans }} & {{ "demi.detail.package.tab.acco"|trans }}
  281.                             </a>
  282.                         </li>
  283.                         {% if hasRatingWidget %}
  284.                             <li class="nav-item">
  285.                                 <a class="nav-link js-param-tab{{ activeTab == anchors['rating'] ? ' active' : '' }} js-tracking js-tracking--click"
  286.                                    href="{{ anchors['rating'] }}"
  287.                                    data-toggle="tab"
  288.                                    role="tab"
  289.                                    aria-expanded="{{ activeTab == anchors['rating'] ? 'true' : 'false' }}"
  290.                                    data-tracking-category="button"
  291.                                    data-tracking-action="rating"
  292.                                    data-tracking-label="{{ accommodation.getName()|escape }}">
  293.                                     {{ "demi.detail.tab.ratings"|trans }}
  294.                                 </a>
  295.                             </li>
  296.                         {% endif %}
  297.                         <li class="nav-item">
  298.                             <a class="nav-link js-param-tab js-acco-images__tab{{ activeTab == anchors['pictures'] ? ' active' : '' }} js-tracking js-tracking--click"
  299.                                href="{{ anchors['pictures'] }}"
  300.                                data-toggle="tab"
  301.                                role="tab"
  302.                                aria-expanded="{{ activeTab == anchors['pictures'] ? 'true' : 'false' }}"
  303.                                data-tracking-category="button"
  304.                                data-tracking-action="picture"
  305.                                data-tracking-label="{{ accommodation.getName()|escape }}">
  306.                                 {% if videoCount == 0 %}
  307.                                     {{ "demi.detail.tab.photos"|trans }}
  308.                                 {% else %}
  309.                                     {{ "demi.detail.tab.photos-videos"|trans }}
  310.                                 {% endif %}
  311.                             </a>
  312.                         </li>
  313.                         <li class="nav-item">
  314.                             <a class="nav-link js-param-tab{{ activeTab == anchors['booking'] ? ' active' : '' }} js-tracking js-tracking--click"
  315.                                href="{{ anchors['booking'] }}"
  316.                                data-toggle="tab"
  317.                                role="tab"
  318.                                aria-expanded="{{ activeTab == anchors['booking'] ? 'true' : 'false' }}"
  319.                                data-tracking-category="button"
  320.                                data-tracking-action="{{ "demi.detail.package.tab.availability"|trans }}"
  321.                                data-tracking-label="package-booking">
  322.                                 {{ "demi.detail.package.tab.availability"|trans }}
  323.                             </a>
  324.                         </li>
  325.                     </ul>
  326.                 </div>
  327.                 <div class="pb-4 pt-2">
  328.                     <div class="tab-content">
  329.                         <div class="tab-pane pt-2{{ activeTab == anchors['details'] ? ' active' : '' }}" id="details" role="tabpanel">
  330.                             {{ include("@ElementsDemiFrontend/Accommodation/includes/package-details.desktop.html.twig",{
  331.                                 'housePackageMaster': housePackageMaster,
  332.                                 'accommodation': accommodation
  333.                             }) }}
  334.                             {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-details.desktop.html.twig" ,{
  335.                                 'package': true,
  336.                                 'address': address,
  337.                                 'photoCount': photoCount,
  338.                                 'availabilityIsChecked': availabilityIsChecked,
  339.                                 'fromDate': fromDate
  340.                             }) }}
  341.                         </div>
  342.                         {% if hasRatingWidget %}
  343.                             <div class="tab-pane pt-2{{ activeTab == anchors['rating'] ? ' active' : '' }}" id="ratings" role="tabpanel">
  344.                                 {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-ratings.desktop.html.twig", {'hasRatingWidget': hasRatingWidget, 'package' : true}) }}
  345.                             </div>
  346.                         {% endif %}
  347.                         <div class="tab-pane pt-2{{ activeTab == anchors['pictures'] ? ' active' : '' }}" id="pictures" role="tabpanel">
  348.                             {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-pictures.desktop.html.twig", {
  349.                                 'photoCount': photoCount,
  350.                                 'videoCount': videoCount,
  351.                                 'panoCount': panoCount,
  352.                                 'impressionsLinks': impressionLinks,
  353.                                 'fromDate': fromDate,
  354.                                 'imageList': imageList,
  355.                                 'accoId': accommodation.getId(),
  356.                                 'housePackageMasterId': housePackageMaster.getId(),
  357.                                 'package' : true
  358.                             }) }}
  359.                         </div>
  360.                         <div class="tab-pane pt-2{{ activeTab == anchors['booking'] ? ' active' : '' }}" id="booking" role="tabpanel">
  361.                             {{ include('@ElementsDemiFrontend/Accommodation/includes/acco-rooms.html.twig', {
  362.                                 'package': true,
  363.                                 'availabilityIsChecked': availabilityIsChecked,
  364.                                 'housePackageMaster': housePackageMaster,
  365.                                 'productResultSet': housePackageResultSet,
  366.                                 'tvbPackage' : packages is defined ? packages : null,
  367.                                 'resultSetPresent' : availabilityIsChecked,
  368.                                 'accommodationResultSet' : accommodationResultSet is defined ? accommodatonReslutSet : null,
  369.                             }) }}
  370.                         </div>
  371.                     </div>
  372.                 </div>
  373.             </div>
  374.             {{ include("@ElementsDemiFrontend/Accommodation/includes/acco-sidebar.desktop.html.twig",{
  375.                 'accommodationResultSet': housePackageResultSet,
  376.                 'productResultSet': housePackageResultSet,
  377.                 'isPackage': true,
  378.             }) }}
  379.         </div>
  380.     </div>
  381. </main>
  382.     {% if not demi_core_configuration("getDisableEnquiry",[]) and accommodation.getAddress() is not empty and accommodation.getAddress().getEmail() is not empty %}
  383.         {{ include('@ElementsDemiFrontend/Includes/overlays/inquiry-overlay.html.twig', {
  384.         'accommodation': accommodation,
  385.         'searchParams': searchParam,
  386.         'user': user
  387.     }) }}
  388.     {% endif %}
  389.     {% if demi_core_configuration('getWarningOnMultipleAccoProducts',[]) %}
  390.         {{ include('@ElementsDemiFrontend/Includes/modals/warningOnMultipleAccoProductsModal.html.twig', {'cartUrl': step1Url}) }}
  391.     {% endif %}
  392. {% endblock %}