diff --git a/src/Export/Data/Entity/ProductEntity.php b/src/Export/Data/Entity/ProductEntity.php
index ab4a3dd1..4d25b748 100644
--- a/src/Export/Data/Entity/ProductEntity.php
+++ b/src/Export/Data/Entity/ProductEntity.php
@@ -57,6 +57,11 @@ public function getProductNumber(): string
return $this->product->getProductNumber();
}
+ public function getProductName(): string
+ {
+ return (string) $this->product->getTranslation('name');
+ }
+
public function getFilterAttributes(): string
{
return $this->filterAttributes;
@@ -100,7 +105,7 @@ public function toArray(): array
$defaultFields = [
'ProductNumber' => $this->product->getProductNumber(),
'Master' => $isVariant ? $this->parent->getProductNumber() : $this->product->getProductNumber(),
- 'Name' => (string) $this->product->getTranslation('name'),
+ 'Name' => $this->getProductName(),
'FilterAttributes' => $this->getFilterAttributes(),
'CustomFields' => $this->getCustomFields(),
];
diff --git a/src/Export/Data/Entity/ProductEntityInterface.php b/src/Export/Data/Entity/ProductEntityInterface.php
index e155b18d..342404a0 100644
--- a/src/Export/Data/Entity/ProductEntityInterface.php
+++ b/src/Export/Data/Entity/ProductEntityInterface.php
@@ -7,4 +7,5 @@
interface ProductEntityInterface
{
public function getProductNumber(): string;
+ public function getProductName(): string;
}
diff --git a/src/Export/Data/Entity/VariantEntity.php b/src/Export/Data/Entity/VariantEntity.php
index a21ed53f..6c45d892 100644
--- a/src/Export/Data/Entity/VariantEntity.php
+++ b/src/Export/Data/Entity/VariantEntity.php
@@ -42,9 +42,14 @@ public function getProductNumber(): string
return $this->product->getProductNumber();
}
+ public function getProductName(): string
+ {
+ return $this->product->getTranslation('name') ? (string) $this->product->getTranslation('name') : $this->parentData['Name'];
+ }
+
public function toArray(): array
{
$opts = '|' . implode('|', map($this->propertyFormatter, $this->product->getOptions()->getElements())) . '|';
- return array_reduce($this->variantFields, fn (array $fields, FieldInterface $field): array => [$field->getName() => $field->getValue($this->product)] + $fields, ['ProductNumber' => $this->product->getProductNumber(), 'FilterAttributes' => $opts] + $this->parentData);
+ return array_reduce($this->variantFields, fn (array $fields, FieldInterface $field): array => [$field->getName() => $field->getValue($this->product)] + $fields, ['ProductNumber' => $this->product->getProductNumber(), 'Name' => $this->getProductName(), 'FilterAttributes' => $opts] + $this->parentData);
}
}
diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml
index a35b8cd4..baa1a0d2 100644
--- a/src/Resources/config/services.xml
+++ b/src/Resources/config/services.xml
@@ -46,6 +46,7 @@
children.media
+ children.translations
CategoryPath