Skip to content

Commit 065ab55

Browse files
committed
Fix bug linked product position not updated if product link already exists
1 parent 137022f commit 065ab55

File tree

1 file changed

+8
-8
lines changed
  • app/code/Magento/CatalogImportExport/Model/Import

1 file changed

+8
-8
lines changed

app/code/Magento/CatalogImportExport/Model/Import/Product.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1230,15 +1230,15 @@ protected function _saveLinks()
12301230
'linked_product_id' => $linkedId,
12311231
'link_type_id' => $linkId,
12321232
];
1233-
if (!empty($linkPositions[$linkedKey])) {
1234-
$positionRows[] = [
1235-
'link_id' => $productLinkKeys[$linkKey],
1236-
'product_link_attribute_id' => $positionAttrId[$linkId],
1237-
'value' => $linkPositions[$linkedKey],
1238-
];
1239-
}
1240-
$nextLinkId++;
12411233
}
1234+
if (!empty($linkPositions[$linkedKey])) {
1235+
$positionRows[] = [
1236+
'link_id' => $productLinkKeys[$linkKey],
1237+
'product_link_attribute_id' => $positionAttrId[$linkId],
1238+
'value' => $linkPositions[$linkedKey],
1239+
];
1240+
}
1241+
$nextLinkId++;
12421242
}
12431243
}
12441244
}

0 commit comments

Comments
 (0)