From 858a6d1886f82c86788aa5b2e93a42ec096a19dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Thu, 7 Apr 2022 15:20:10 +0200 Subject: [PATCH] Fix incorrect calculation of total price for flex products --- .../ext/ep_products/Classes/Service/ContingentDataService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/typo3conf/ext/ep_products/Classes/Service/ContingentDataService.php b/public/typo3conf/ext/ep_products/Classes/Service/ContingentDataService.php index 5e3b91f4..f98a1eb7 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/ContingentDataService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/ContingentDataService.php @@ -91,7 +91,7 @@ class ContingentDataService ) { $data = $this->contingentRepository->getAvailableRooms($dateFrom, $dateTo, $hotel, $product); $period = new Period($dateFrom, $dateTo); - $nights = $period->getDateInterval()->format('%a'); + $nights = $period->dateInterval()->format('%a'); $rooms = []; @@ -108,7 +108,7 @@ class ContingentDataService $row['servicesIncluded'] = unserialize($row['servicesIncluded'], ['allowed_classes' => false]); $row['servicesOptional'] = unserialize($row['servicesOptional'], ['allowed_classes' => false]); - $row['priceForSelection'] = $row['price'] * $row['minNights'] + ($nights - $row['minNights']) * $row['additionalNightPrice']; + $row['priceForSelection'] = $row['price'] + ($nights - $row['minNights']) * $row['additionalNightPrice']; $rooms[] = $row; }