Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves #668: Products Duplicated in Initial Mapping Using UUID and Error on Subsequent Imports. #669

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Helper/Import/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
Expand All @@ -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);
Expand Down