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

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