diff --git a/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php b/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php index 6a7e94a5..5a9d267d 100644 --- a/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php +++ b/web/typo3conf/ext/ep_products/Classes/Service/DateImportService.php @@ -298,11 +298,18 @@ class DateImportService implements SingletonInterface */ protected function parseDaytripDates(\SimpleXMLElement $xmlDate, array $product) { + static $datesAdded = []; + foreach ($xmlDate->hotel as $xmlHotel) { $hotelCode = (string) $xmlHotel->attributes()['code']; - $hotel = $this->hotelMappings[$hotelCode]; $dateStart = \DateTime::createFromFormat('d.m.Y', (string) $xmlDate->attributes()['termin'])->format('Y-m-d'); + $key = $hotelCode . $dateStart; + if (\in_array($key, $datesAdded, true)) { + continue; + } + $datesAdded[] = $key; + $hotel = $this->hotelMappings[$hotelCode]; $this->db->insert( 'tx_epproducts_domain_model_daytrip_temp', [