From 369653c4e7109d30cff00db21fc59037c697f669 Mon Sep 17 00:00:00 2001 From: Marek Date: Sat, 2 Dec 2023 16:59:32 +0100 Subject: [PATCH] Fixes issue of product duplication in initial import using UUID #668 --- Helper/Import/Product.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Helper/Import/Product.php b/Helper/Import/Product.php index 337913f2..66ede7e8 100755 --- a/Helper/Import/Product.php +++ b/Helper/Import/Product.php @@ -451,7 +451,7 @@ public function matchEntity($pimKey, $entityTable, $entityKey, $import, $prefix $existingEntities = array_column($existingEntities, 'entity_id'); // Get all entities that are being imported and already present in Magento - $select = $connection->select()->from(['t' => $tableName], ['sku' => 't.identifier'])->joinInner( + $select = $connection->select()->from(['t' => $tableName], ['code' => 't.' . $pimKey])->joinInner( ['e' => $entityTable], 't.identifier = e.sku' ); @@ -463,7 +463,7 @@ public function matchEntity($pimKey, $entityTable, $entityKey, $import, $prefix if (!in_array($row['entity_id'], $existingEntities)) { $values = [ 'import' => 'product', - 'code' => $row['sku'], + 'code' => $row['code'], 'entity_id' => $row['entity_id'], ]; $connection->insertOnDuplicate($akeneoConnectorTable, $values);