Feat: Trim value from XML attribute to avoid matching issues
This commit is contained in:
@@ -535,7 +535,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
$count = 0;
|
$count = 0;
|
||||||
|
|
||||||
foreach ($xmlHotel->xpath('zimmer/preis') as $roomXml) {
|
foreach ($xmlHotel->xpath('zimmer/preis') as $roomXml) {
|
||||||
$code = (string) $roomXml->attributes()['zimmercode'];
|
$code = trim((string) $roomXml->attributes()['zimmercode']);
|
||||||
|
|
||||||
if ($code === static::CODE_PSEUDOPRICE) {
|
if ($code === static::CODE_PSEUDOPRICE) {
|
||||||
$price = (int) $roomXml->attributes()['preis'];
|
$price = (int) $roomXml->attributes()['preis'];
|
||||||
@@ -733,10 +733,11 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
|||||||
|
|
||||||
protected function getRoomMappings(): void
|
protected function getRoomMappings(): void
|
||||||
{
|
{
|
||||||
$sql = 'SELECT code, type FROM tx_epproducts_domain_model_roommapping';
|
$sql = 'SELECT code, type FROM tx_epproducts_domain_model_roommapping WHERE deleted = 0 AND hidden = 0';
|
||||||
$roomMappings = $this->db->fetchAllAssociative($sql);
|
$roomMappings = $this->db->fetchAllAssociative($sql);
|
||||||
foreach ($roomMappings as $mapping) {
|
foreach ($roomMappings as $mapping) {
|
||||||
$this->roomMappings[mb_strtolower($mapping['code'])] = $mapping['type'];
|
$key = trim(mb_strtolower($mapping['code']));
|
||||||
|
$this->roomMappings[$key] = $mapping['type'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user