diff --git a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index adf410c3..7aed681a 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -525,7 +525,8 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface */ protected function parseRooms(\SimpleXMLElement $xmlHotel, $hotelUid, array &$date, array $services) { - $minPrice = 0; + $minPriceOverall = 0; + $minPriceAvailable = 0; $availableTotal = 0; $boardCode = ''; $count = 0; @@ -561,8 +562,14 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface $pax = (int) $roomXml->attributes()['MaxPax']; $availableTotal += $available * $pax; - if ($code !== static::CODE_BABYROOM && $available > 0 && ($minPrice === 0 || $price < $minPrice)) { - $minPrice = $price; + // Determine lowest price of available rooms + if ($code !== static::CODE_BABYROOM && $available > 0 && ($minPriceAvailable === 0 || $price < $minPriceAvailable)) { + $minPriceAvailable = $price; + } + + // Determine lowest overall price + if ($code !== static::CODE_BABYROOM && ($minPriceOverall === 0 || $price < $minPriceOverall)) { + $minPriceOverall = $price; } if ($roomXml->attributes()['status'] === static::STATUS_STOP && $price && !$available) { @@ -600,7 +607,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface } $date['board_code'] = $boardCode; - $date['min_price'] = $minPrice; + $date['min_price'] = $minPriceAvailable ?: $minPriceOverall; $date['available'] = $availableTotal; $date['rooms'] = $count; }