feat: toggle ski pass in teasers in favor of hardcoded string

closes #869bxcc9c
This commit is contained in:
Björn Fromme
2026-01-27 19:05:36 +01:00
parent d8c2939402
commit b1ef3dd13c
19 changed files with 34 additions and 27 deletions
@@ -148,7 +148,7 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa
'c.additional_night_min_price as additionalNightPrice', 'c.additional_night_min_price as additionalNightPrice',
'c.additional_night_min_nights as additionalNightMinNights', 'd.bus_pro_id as busProId', 'c.additional_night_min_nights as additionalNightMinNights', 'd.bus_pro_id as busProId',
'd.services_included as servicesIncluded', 'd.services_general as servicesOptional', 'd.services_included as servicesIncluded', 'd.services_general as servicesOptional',
'd.skipass_included as skipassIncluded', 'd.season as season') 'd.skipass_included as skiPassIncluded', 'd.season as season')
->from('tx_epproducts_domain_model_contingent', 'c') ->from('tx_epproducts_domain_model_contingent', 'c')
->innerJoin('c', 'tx_epproducts_domain_model_date', 'd', 'c.date = d.date_start AND c.hotel_code = d.hotel_code') ->innerJoin('c', 'tx_epproducts_domain_model_date', 'd', 'c.date = d.date_start AND c.hotel_code = d.hotel_code')
->where('c.hotel = :hotelUid') ->where('c.hotel = :hotelUid')
@@ -26,8 +26,8 @@ class ProductRepository extends AbstractRepository
'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent', 'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent',
'date.board as board', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.board as board', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact',
'date.region_fact as regionFact', 'date.services_included as servicesIncluded', 'date.region_fact as regionFact', 'date.services_included as servicesIncluded',
'date.min_price as minPrice', 'date.nights as nights', 'date.available as available', 'date.skipass_included as skiPassIncluded', 'date.min_price as minPrice', 'date.nights as nights',
'date.pseudo_price as pseudoPrice' 'date.available as available', 'date.pseudo_price as pseudoPrice'
) )
->from('tx_epproducts_domain_model_date', 'date') ->from('tx_epproducts_domain_model_date', 'date')
->where($qb->expr()->in( ->where($qb->expr()->in(
@@ -71,7 +71,7 @@ class ProductRepository extends AbstractRepository
'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent', 'date.earlybird as earlybird', 'date.new as new', 'date.low_contingent as lowContingent',
'date.board as board', 'date.board_bus_pro_id as boardUid', 'date.board as board', 'date.board_bus_pro_id as boardUid',
'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact', 'date.product_fact as productFact', 'date.hotel_fact as hotelFact', 'date.region_fact as regionFact',
'date.services_included as servicesIncluded', 'date.services_included as servicesIncluded', 'date.skipass_included as skiPassIncluded',
'date.bus_available as busAvailable', 'date.new as new', 'date.bus_available as busAvailable', 'date.new as new',
'date.min_price as minPrice', 'date.nights as nights', 'date.available as available', 'date.min_price as minPrice', 'date.nights as nights', 'date.available as available',
'date.pseudo_price as pseudoPrice', 'date.hide_booking_button as hideBookingButton', 'date.pseudo_price as pseudoPrice', 'date.hide_booking_button as hideBookingButton',
@@ -134,7 +134,7 @@ class ProductRepository extends AbstractRepository
'country_name as countryName', 'country_code as countryCode', 'country_name as countryName', 'country_code as countryCode',
'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice', 'date_start as dateStart', 'date_end as dateEnd', 'uid as dateUid', 'min_price as minPrice',
'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'season as season', 'pseudo_price as pseudoPrice', 'nights as nights', 'available as available', 'season as season',
'skipass_included as skipassIncluded', 'bus_included as busIncluded', 'skipass_included as skiPassIncluded', 'bus_included as busIncluded',
'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton', 'earlybird', 'new', 'daytrip', 'hide_booking_button as hideBookingButton',
'low_contingent as lowContingent', 'concept as conceptUid', 'concept_code as conceptCode', 'low_contingent as lowContingent', 'concept as conceptUid', 'concept_code as conceptCode',
'concept_name as conceptName', 'concept_popup_text as conceptPopupText', 'board', 'new' 'concept_name as conceptName', 'concept_popup_text as conceptPopupText', 'board', 'new'
@@ -200,7 +200,7 @@ class ProductRepository extends AbstractRepository
->select( ->select(
'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd', 'date.uid as dateUid', 'date.date_start as dateStart', 'date.date_end as dateEnd',
'date.bus_pro_id as dateBusProId', 'date.hotel as hotelUid', 'date.hotel_bus_pro_id as hotelBusProId', 'date.bus_pro_id as dateBusProId', 'date.hotel as hotelUid', 'date.hotel_bus_pro_id as hotelBusProId',
'date.bus_included as dateBusIncluded', 'date.skipass_included as dateSkipassIncluded', 'date.bus_included as dateBusIncluded', 'date.skipass_included as dateSkiPassIncluded',
'date.season as season', 'date.product_detail_page as productDetailPage', 'date.season as season', 'date.product_detail_page as productDetailPage',
'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.name as roomName', 'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.name as roomName',
'room.price as roomPrice', 'date.discount as roomDiscount', 'date.bus_price as busPrice', 'room.price as roomPrice', 'date.discount as roomDiscount', 'date.bus_price as busPrice',
@@ -263,7 +263,7 @@ class ProductRepository extends AbstractRepository
'date.season as season', 'date.min_price as dateMinPrice', 'date.pseudo_price as datePseudoPrice', 'date.season as season', 'date.min_price as dateMinPrice', 'date.pseudo_price as datePseudoPrice',
'date.discount as dateDiscount', 'date.bus_price as busPrice', 'date.nights as dateNights', 'date.discount as dateDiscount', 'date.bus_price as busPrice', 'date.nights as dateNights',
'date.bus_included as dateBusIncluded', 'date.services_included as dateServicesIncluded', 'date.bus_included as dateBusIncluded', 'date.services_included as dateServicesIncluded',
'date.services_general as dateServicesGeneral', 'date.skipass_included as dateSkipassIncluded', 'date.services_general as dateServicesGeneral', 'date.skipass_included as dateSkiPassIncluded',
'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId', 'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId',
'date.available as available', 'date.product_detail_page as productDetailPage', 'date.available as available', 'date.product_detail_page as productDetailPage',
) )
@@ -332,7 +332,7 @@ class ProductRepository extends AbstractRepository
'date.min_price as dateMinPrice', 'date.discount as dateDiscount', 'date.bus_price as busPrice', 'date.min_price as dateMinPrice', 'date.discount as dateDiscount', 'date.bus_price as busPrice',
'date.nights as dateNights', 'date.bus_included as dateBusIncluded', 'date.bus_price as busPrice', 'date.nights as dateNights', 'date.bus_included as dateBusIncluded', 'date.bus_price as busPrice',
'date.services_included as dateServicesIncluded', 'date.services_general as dateServicesGeneral', 'date.services_included as dateServicesIncluded', 'date.services_general as dateServicesGeneral',
'date.skipass_included as dateSkipassIncluded', 'date.bus_pro_id as dateBusProId', 'date.skipass_included as dateSkiPassIncluded', 'date.bus_pro_id as dateBusProId',
'date.discount as roomDiscount', 'date.hotel_bus_pro_id as hotelBusProId', 'date.pickups as pickups', 'date.discount as roomDiscount', 'date.hotel_bus_pro_id as hotelBusProId', 'date.pickups as pickups',
'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.code as roomCode', 'room.uid as roomUid', 'room.bus_pro_id as roomBusProId', 'room.code as roomCode',
'room.name as roomName', 'room.price as roomPrice', 'room.pax as roomPax', 'room.name as roomName', 'room.price as roomPrice', 'room.pax as roomPax',
@@ -46,7 +46,7 @@ class Date
$date['to'] = $array['dateEnd']; $date['to'] = $array['dateEnd'];
$date['minprice'] = $array['dateMinPrice']; $date['minprice'] = $array['dateMinPrice'];
$date['nights'] = $array['dateNights']; $date['nights'] = $array['dateNights'];
$date['skipassincluded'] = $array['dateSkipassIncluded']; $date['skipassincluded'] = $array['dateSkiPassIncluded'];
$date['busincluded'] = $array['dateBusIncluded']; $date['busincluded'] = $array['dateBusIncluded'];
$date['servicesincluded']['service'] = unserialize($array['dateServicesIncluded']); $date['servicesincluded']['service'] = unserialize($array['dateServicesIncluded']);
$servicesGeneral = unserialize($array['dateServicesGeneral']); $servicesGeneral = unserialize($array['dateServicesGeneral']);
@@ -229,7 +229,7 @@ class DateService implements SingletonInterface
'season' => $row['season'], 'season' => $row['season'],
'summer' => $row['season'] === 's', 'summer' => $row['season'] === 's',
'busIncluded' => (bool) $row['dateBusIncluded'], 'busIncluded' => (bool) $row['dateBusIncluded'],
'skipassIncluded' => (bool) $row['dateSkipassIncluded'], 'skiPassIncluded' => (bool) $row['dateSkiPassIncluded'],
'roomUid' => $row['roomUid'], 'roomUid' => $row['roomUid'],
'roomName' => $row['roomName'], 'roomName' => $row['roomName'],
'available' => $row['roomAvailable'] && $row['roomPrice'], 'available' => $row['roomAvailable'] && $row['roomPrice'],
@@ -319,7 +319,7 @@ class DateService implements SingletonInterface
'discount' => $row['dateDiscount'] ?? 0, 'discount' => $row['dateDiscount'] ?? 0,
'nights' => $row['dateNights'], 'nights' => $row['dateNights'],
'busIncluded' => (bool) $row['dateBusIncluded'], 'busIncluded' => (bool) $row['dateBusIncluded'],
'skipassIncluded' => (bool) $row['dateSkipassIncluded'], 'skiPassIncluded' => (bool) $row['dateSkiPassIncluded'],
'servicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]), 'servicesIncluded' => unserialize($row['dateServicesIncluded'], ['allowed_classes' => false]),
'servicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]), 'servicesGeneral' => unserialize($row['dateServicesGeneral'], ['allowed_classes' => false]),
'season' => $row['season'], 'season' => $row['season'],
@@ -434,7 +434,7 @@ class DateService implements SingletonInterface
public function hasIncludedServices(array $tableData): bool public function hasIncludedServices(array $tableData): bool
{ {
foreach ($tableData as $row) { foreach ($tableData as $row) {
if ($row['busIncluded'] || $row['skipassIncluded']) { if ($row['busIncluded'] || $row['skiPassIncluded']) {
return true; return true;
} }
} }
@@ -131,8 +131,8 @@ class ProductDataService implements SingletonInterface
$teaser['dates'][] = $row['dateStart']; $teaser['dates'][] = $row['dateStart'];
} }
if (!$teaser['skipassIncluded'] && $row['skipassIncluded']) { if (!$teaser['skiPassIncluded'] && $row['skiPassIncluded']) {
$teaser['skipassIncluded'] = true; $teaser['skiPassIncluded'] = true;
} }
if (!$teaser['busIncluded'] && $row['busIncluded']) { if (!$teaser['busIncluded'] && $row['busIncluded']) {
@@ -158,6 +158,7 @@ class SearchResultService implements SingletonInterface
'nights' => [], 'nights' => [],
'rooms' => [], 'rooms' => [],
'new' => $row['new'], 'new' => $row['new'],
'skiPassIncluded' => $row['skiPassIncluded'],
]; ];
$total++; $total++;
} }
@@ -72,7 +72,7 @@
{ep:icon(icon: 'bus', class: 'w-4 h-4 md:w-5 md:h-5')} {ep:icon(icon: 'bus', class: 'w-4 h-4 md:w-5 md:h-5')}
</span> </span>
</f:if> </f:if>
<f:if condition="{row.skipassIncluded}"> <f:if condition="{row.skiPassIncluded}">
<span data-cooltipz-dir="top" <span data-cooltipz-dir="top"
aria-label="Skipass" aria-label="Skipass"
role="tooltip"> role="tooltip">
@@ -65,7 +65,7 @@
</div> </div>
<f:render partial="Badge" arguments="{badge: product.badge}"/> <f:render partial="Badge" arguments="{badge: product.badge}"/>
</div> </div>
<f:if condition="{settings.showSkipassBadge} && {product.skipassIncluded}"> <f:if condition="{settings.showSkipassBadge} && {product.skiPassIncluded}">
<div class="herounit__badge-wrapper"> <div class="herounit__badge-wrapper">
<f:link.typolink parameter="{settings.skipassPageUid}" <f:link.typolink parameter="{settings.skipassPageUid}"
class="herounit__badge herounit__badge--skipass"> class="herounit__badge herounit__badge--skipass">
@@ -96,14 +96,14 @@
ab <span class="product-teaser__price mx-1">{minPrice} €</span> ab <span class="product-teaser__price mx-1">{minPrice} €</span>
</div> </div>
<div class="product-teaser__label-price"> <div class="product-teaser__label-price">
p. P.{f:if(condition: '{season} == "w"', then: ' / inkl. Skipass')} p. P.{f:if(condition: '{season} == "w" && {skiPassIncluded}', then: ' / inkl. Skipass')}
</div> </div>
</div> </div>
</div> </div>
</f:section> </f:section>
<f:section name="Including"> <f:section name="Including">
<f:if condition="{season} == 'w'"> <f:if condition="{season} == 'w' && {skiPassIncluded}">
<li class="flex items-center space-x-1 py-1"> <li class="flex items-center space-x-1 py-1">
{ep:icon(class: 'w-6 h-6 text-ep-primary-light', icon: 'check')} {ep:icon(class: 'w-6 h-6 text-ep-primary-light', icon: 'check')}
<span class="block flex-1 leading-none">Skipass</span> <span class="block flex-1 leading-none">Skipass</span>
@@ -91,7 +91,8 @@
forceHotelUid: teaser.forceHotelUid, forceHotelUid: teaser.forceHotelUid,
dateFrom: teaser.minDateStart, dateFrom: teaser.minDateStart,
dateTo: teaser.maxDateEnd, dateTo: teaser.maxDateEnd,
index: iteration.index index: iteration.index,
skiPassIncluded: teaser.skiPassIncluded
}"/> }"/>
</f:for> </f:for>
</div> </div>
@@ -83,6 +83,7 @@
forceHotelUid: 1, forceHotelUid: 1,
showHotelDetails: 1, showHotelDetails: 1,
new: item.new, new: item.new,
skiPassIncluded: item.skiPassIncluded,
referringPageUri: referringPageUri referringPageUri: referringPageUri
}"/> }"/>
</f:for> </f:for>
@@ -100,7 +100,7 @@
<span class="block"></span> <span class="block"></span>
</f:else> </f:else>
</f:if> </f:if>
<f:if condition="{row.skipassIncluded}"> <f:if condition="{row.skiPassIncluded}">
<f:then> <f:then>
<span class="block p-1" <span class="block p-1"
data-cooltipz-dir="top" data-cooltipz-dir="top"
@@ -44,7 +44,7 @@
ab {row.priceForSelection} € ab {row.priceForSelection} €
</td> </td>
<td class="border-r border-zinc-200 px-2 py-1 md:p-2"> <td class="border-r border-zinc-200 px-2 py-1 md:p-2">
<f:if condition="{row.skipassIncluded}"> <f:if condition="{row.skiPassIncluded}">
<span data-cooltipz-dir="top" <span data-cooltipz-dir="top"
aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}" aria-label="{f:if(condition: row.summer, then: 'Bergbahnticket inklusive', else: 'Skipass inklusive')}"
role="tooltip"> role="tooltip">
@@ -219,7 +219,7 @@
<span class="block"></span> <span class="block"></span>
</f:else> </f:else>
</f:if> </f:if>
<f:if condition="{row.skipassIncluded}"> <f:if condition="{row.skiPassIncluded}">
<f:then> <f:then>
<span class="block p-1" <span class="block p-1"
data-cooltipz-dir="top" data-cooltipz-dir="top"
@@ -61,7 +61,8 @@
forceHotelUid: teaser.forceHotelUid, forceHotelUid: teaser.forceHotelUid,
dateFrom: dateFrom, dateFrom: dateFrom,
dateTo: dateTo, dateTo: dateTo,
index: iteration.index index: iteration.index,
skiPassIncluded: teaser.skiPassIncluded
}"/> }"/>
</f:for> </f:for>
</div> </div>
@@ -72,7 +72,8 @@
dateFrom: dateFrom, dateFrom: dateFrom,
dateTo: dateTo, dateTo: dateTo,
index: iteration.index, index: iteration.index,
globalConceptCode: settings.globalConceptCode globalConceptCode: settings.globalConceptCode,
skiPassIncluded: teaser.skiPassIncluded
}"/> }"/>
</f:for> </f:for>
</div> </div>
@@ -24,6 +24,7 @@
dateFrom: dateFrom, dateFrom: dateFrom,
dateTo: dateTo, dateTo: dateTo,
new: teaser.new, new: teaser.new,
skiPassIncluded: teaser.skiPassIncluded,
landscape: '{f:if(condition: \'{data.layout} == 2 || {data.layout} == 3\', then: 1, else: 0)}' landscape: '{f:if(condition: \'{data.layout} == 2 || {data.layout} == 3\', then: 1, else: 0)}'
}"/> }"/>
</f:if> </f:if>
@@ -53,7 +53,8 @@
dateTo: dateTo, dateTo: dateTo,
new: teaser.new, new: teaser.new,
index: iteration.index, index: iteration.index,
globalConceptCode: settings.globalConceptCode globalConceptCode: settings.globalConceptCode,
skiPassIncluded: teaser.skiPassIncluded
}"/> }"/>
</f:for> </f:for>
</div> </div>
@@ -131,11 +131,11 @@
</tr> </tr>
<tr> <tr>
<th>Bus inkl.</th> <th>Bus inkl.</th>
<td>{f:if(condition: date.busincluded, then: 'ja', else: 'nein')}</td> <td>{f:if(condition: date.busIncluded, then: 'ja', else: 'nein')}</td>
</tr> </tr>
<tr> <tr>
<th>Skipass inkl.</th> <th>Skipass inkl.</th>
<td>{f:if(condition: date.skipassincluded, then: 'ja', else: 'nein')}</td> <td>{f:if(condition: date.skiPassIncluded, then: 'ja', else: 'nein')}</td>
</tr> </tr>
<tr> <tr>
<th>Zimmer</th> <th>Zimmer</th>