From 7ab57a51cb8ee68fc336b272d97cc9bb7ef433a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bjo=CC=88rn=20Fromme?= Date: Tue, 21 Jul 2020 09:47:15 +0200 Subject: [PATCH] Hide hotels in pricetables that are not shown as teasers --- .../Classes/Domain/Repository/ProductRepository.php | 2 +- .../typo3conf/ext/ep_products/Classes/Service/DateService.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 b5b49b9c..c6a4f993 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ProductRepository.php @@ -360,7 +360,7 @@ class ProductRepository extends AbstractRepository 'date.hotel_category as hotelCategory', 'room.pax as roomPax', 'room.price as roomPrice', 'room.available as available', 'room.pax as roomPax', 'room.price as roomPrice', 'room.available as available', - 'hotel.detail_page as hotelDetailPageUid', 'hotel.short_name as hotelShortName' + 'hotel.detail_page as hotelDetailPageUid', 'hotel.short_name as hotelShortName', 'hotel.show_as_teaser as hotelShowAsTeaser' ) ->from('tx_epproducts_domain_model_date', 'date') ->innerJoin('date', 'tx_epproducts_domain_model_room', 'room', 'room.date = date.uid') diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php index 23211478..c780863f 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateService.php @@ -416,6 +416,10 @@ class DateService implements SingletonInterface foreach ($priceTableData as $row) { + // Skip hotels in price table that are not shown as teasers + if (!$row['hotelShowAsTeaser']) { + continue; + } $categoryUid = $row['hotelCategory']; $hotelUid = $row['hotelUid']; $hotelUri = $this->uriBuilder