src/Elements/Bundle/DemiFrontendBundle/Resources/views/Includes/teaser/offer-teaser.mobile.html.twig line 1

Open in your IDE?
  1. {% if '-' in id %}
  2.     {% set parts = id|split('-') %}
  3.     {% set realId = parts[1] %}
  4. {% endif %}
  5. {% set object = pimcore_object(realId is defined ? realId : id) %}
  6. {% set ariaLabel = 'demi.booking.offer.offer'|trans ~ ': ' ~  object.getName() %}
  7. {% set serviceProvider = object is instanceof('\Pimcore\Model\DataObject\DemiHousePackageMaster') ? object.getServiceProvider() : object.getParent().getParent() %}
  8. {% set trackingServiceProvider = serviceProvider %}
  9. {% set serviceProvider = serviceProvider is instanceof('\Elements\Demi\Model\AccommodationServiceProvider') ? serviceProvider : null %}
  10. {% if opensOverlay %}
  11.     <script>
  12.         _config.overlay = true;
  13.     </script>
  14. {% endif %}
  15. <section class="card-body {{ opensOverlay ? 'js-overlay__toggle': 'isClickable' }} js-tracking js-tracking--impression  {% if object is instanceof('\Elements\Demi\Model\Package') %}card--package{% endif %}"
  16.     {% if opensOverlay %}
  17.         data-target="#overlay-{{ id }}" tabindex="-1"
  18.     {% endif %}
  19.     {% set trackingCategory = constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::CATEGORY_ZUSATZLEISTUNGEN_GENERIC") %}
  20.     {% set trackingList = constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_ZUSATZLEISTUNGEN") %}
  21.     {% set trackingVariant = object.getName() %}
  22.     {% if object is instanceof('\Elements\Demi\Model\HousePackageMaster') %}
  23.         {% set trackingCategory = demi_impressionCategory(trackingServiceProvider,object,searchParam) %}
  24.         {% set trackingList =  constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_LIST") ~ " " ~ constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_PACKAGE_ACCODETAIL") %}
  25.     {% elseif object is instanceof('Elements\Demi\Model\Package') %}
  26.         {% set trackingList =  constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::LIST_ZUSATZLEISTUNGEN_DESTINATIONPACKAGE") %}
  27.         {% set trackingCategory = constant("Elements\\Bundle\\DemiFrontendBundle\\Service\\Tracking::CATEGORY_ZUSATZLEISTUNGEN_GENERIC") %}
  28.         {% set trackingVariant = object.getName() ~ "/" %}
  29.     {% elseif object is instanceof('\Elements\Demi\Model\AdditionalProduct')  %}
  30.          {% set trackingCategory = demi_impressionCategory(trackingServiceProvider,null,searchParam,null,object) %}
  31.     {% endif %}
  32.      data-tracking-name="{{ demi_impressionName(trackingServiceProvider) }}"
  33.      data-tracking-id="{{ trackingServiceProvider.getId() }}"
  34.      data-tracking-category="{{ trackingCategory }}"
  35.      data-tracking-position="{{ position }}"
  36.      data-tracking-brand="{{ demi_impressionBrand(trackingServiceProvider) }}"
  37.      data-tracking-list="{{ trackingList }}"
  38.      data-tracking-price="{{ price | number_format(2, '.', '') }}"
  39.      data-tracking-variant="{{ trackingVariant|escape }}"
  40. >
  41.     <div class="row row--gutter-width-10">
  42.         {% if img is defined and img is not null %}
  43.             <div class="col col-auto">
  44.                 {{ img.getThumbnail('demi-mobile-offer-list-teaser').getHtml()|raw }}
  45.             </div>
  46.         {% endif %}
  47.         <div class="col">
  48.             <h3 class="text-primary mb-1">
  49.                 {% if opensOverlay %}
  50.                     <button type="button" class="btn-no-styling">{{ title }}</button>
  51.                 {% else %}
  52.                     <a href="{{ href }}">{{ title }}</a>
  53.                 {% endif %}
  54.             </h3>
  55.             {% if priceInfo is defined %}
  56.                 {% set text = text ~ priceInfo %}
  57.             {% endif %}
  58.             {% if text is empty and ticket is not empty %}
  59.                 {% set text = 'demi.booking.ticket'|trans %}
  60.             {% endif %}
  61.             {% if text is not empty %}
  62.                 <div class="wysiwyg">
  63.                     {{ text|raw }}
  64.                 </div>
  65.             {% endif %}
  66.             <hr class="my-1">
  67.             <div class="row align-items-baseline">
  68.                 <div class="col">
  69.                     {% if specialPrice is defined and specialPrice is not empty %}
  70.                         <div class="text-muted">
  71.                             {{ specialPrice }}
  72.                         </div>
  73.                     {% endif %}
  74.                 </div>
  75.                 <div class="col-auto">
  76.                     <div class="text-right text-success font-bold">
  77.                         <span class="demi-icon demi-icon-cart fz14 mr-1"></span>
  78.                         {% set ticketPriceText = 'demi.booking.cart.ticket-price-text'|trans|trim %}
  79.                         {% if ticket is defined and ticket is not null and ticketPriceText != 'demi.booking.cart.ticket-price-text' %}
  80.                             {{ ticketPriceText }}
  81.                         {% else %}
  82.                             {% if price > 0 %}
  83.                                 {{ 'demi.price-from-short'|trans }} <strong class="fz17 price">{{ demi_paymentGetPriceObject(price, serviceProvider) }}</strong>
  84.                             {% else %}
  85.                                {{ 'demi.booking.free-bookable'|trans }}
  86.                             {% endif %}
  87.                         {% endif %}
  88.                     </div>
  89.                 </div>
  90.             </div>
  91.         </div>
  92.         <div class="col col-auto align-self-center">
  93.             {% if opensOverlay %}
  94.                 <button class="btn-no-styling text-primary demi-icon demi-icon-chevron-right increased-click-area"
  95.                         type="button"
  96.                         title="{{ ariaLabel }}"
  97.                         aria-label="{{ ariaLabel }}"></button>
  98.             {% else %}
  99.                 <a class="btn-no-styling text-primary demi-icon demi-icon-chevron-right increased-click-area"
  100.                    href="{{ href }}"
  101.                    title="{{ ariaLabel }}"
  102.                    aria-label="{{ ariaLabel }}"></a>
  103.             {% endif %}
  104.         </div>
  105.     </div>
  106. </section>