From 498b70409e24715982b1a54edd8e04fd31e990cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 2 Jun 2025 11:49:25 +0200 Subject: [PATCH] feat: highlight prices with undersubscription closes #86998znag --- .../Classes/Domain/Repository/ProductRepository.php | 3 ++- .../ext/ep_products/Classes/Service/DateService.php | 5 ++++- .../Private/Templates/AjaxTable/EventPricetable.html | 6 ++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php index 9cfd8df9..4be07071 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -358,7 +358,8 @@ class ProductRepository extends AbstractRepository 'date.bus_pro_id as dateBusProId', 'date.hotel_bus_pro_id as hotelBusProId', 'date.date_end as dateEnd', 'date.hotel as hotelUid', 'date.hotel_name as hotelName', 'date.hotel_header_title as hotelTitle', 'date.hotel_category as hotelCategory', - 'room.pax as roomPax', 'room.price as roomPrice', 'room.available as available', + 'room.name as roomName', 'room.pax as roomPax', 'room.price as roomPrice', + 'room.available as available', 'hotel.detail_page as hotelDetailPageUid', 'hotel.short_name as hotelShortName', 'hotel.show_as_teaser as hotelShowAsTeaser' ) diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php index c8d90af7..5971ec80 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php @@ -384,6 +384,8 @@ class DateService implements SingletonInterface } $entry =& $priceTable[$categoryUid][$hotelUid]['rooms']; + $isUndersubscription = 1 === preg_match('/mit \d{1,2} Personen/', $row['roomName']); + // Add new entry or replace possible existing entry that is not // bookable with current record in case of matching category // and pax @@ -391,7 +393,7 @@ class DateService implements SingletonInterface $entry[$roomPax] = [ 'price' => $row['roomPrice'], 'available' => $row['available'] && $row['roomPrice'], - + 'undersubscription' => $isUndersubscription, ] ; } else { $lastEntry = $entry[$roomPax]; @@ -399,6 +401,7 @@ class DateService implements SingletonInterface $entry[$roomPax] = [ 'price' => $row['roomPrice'], 'available' => $row['available'] && $row['roomPrice'], + 'undersubscription' => $isUndersubscription, ]; } } diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html index e7d74eba..c849b6ac 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Templates/AjaxTable/EventPricetable.html @@ -20,7 +20,7 @@
- +
@@ -60,8 +60,9 @@ + class="whitespace-nowrap {ep:themeClasses(classes: '{sbw: \'text-sbw-primary\', snz: \'text-snz-primary\', uch: \'text-uch-primary\'}', key: settings.themekey)}"> {row.rooms.{type}.price} + {f:if(condition: '{row.rooms.{type}.undersubscription}', then: '*')} @@ -79,6 +80,7 @@
+

* Preis kommt durch eine Unterbelegung zustande.