diff --git a/ImportExport/Strategy/CategoryImportStrategy.php b/ImportExport/Strategy/CategoryImportStrategy.php index 9293e2c8..28e1b557 100644 --- a/ImportExport/Strategy/CategoryImportStrategy.php +++ b/ImportExport/Strategy/CategoryImportStrategy.php @@ -213,6 +213,22 @@ protected function updateContextCounters($entity) } } + protected function isFieldExcluded($entityName, $fieldName, $itemData = null) + { + $excludeCategoryFields = [ + 'childCategories', + 'slugs', + 'slugPrototypes', + 'slugPrototypesWithRedirect', + ]; + + if (is_a($entityName, Category::class, true) && in_array($fieldName, $excludeCategoryFields)) { + return true; + } + + return parent::isFieldExcluded($entityName, $fieldName, $itemData); + } + protected function mapCollections(Collection $importedCollection, Collection $sourceCollection) { } diff --git a/ImportExport/Strategy/ProductImportStrategy.php b/ImportExport/Strategy/ProductImportStrategy.php index 1bf196cf..eae0c7e4 100644 --- a/ImportExport/Strategy/ProductImportStrategy.php +++ b/ImportExport/Strategy/ProductImportStrategy.php @@ -230,10 +230,16 @@ protected function updateContextCounters($entity) protected function isFieldExcluded($entityName, $fieldName, $itemData = null) { - if ( - is_a($entityName, Product::class, true) - && in_array($fieldName, ['variantLinks', 'parentVariantLinks', 'images']) - ) { + $excludeProductFields = [ + 'variantLinks', + 'parentVariantLinks', + 'images', + 'slugs', + 'slugPrototypes', + 'slugPrototypesWithRedirect', + ]; + + if (is_a($entityName, Product::class, true) && in_array($fieldName, $excludeProductFields)) { return true; }