Skip to content

Commit bb98ac1

Browse files
author
Oleksii Korshenko
authored
MAGETWO-69667: Fix bug linked product position not updated if product link already exists #9810
2 parents 847da0b + 05a5791 commit bb98ac1

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
@@ -1228,15 +1228,15 @@ protected function _saveLinks()
12281228
'linked_product_id' => $linkedId,
12291229
'link_type_id' => $linkId,
12301230
];
1231-
if (!empty($linkPositions[$linkedKey])) {
1232-
$positionRows[] = [
1233-
'link_id' => $productLinkKeys[$linkKey],
1234-
'product_link_attribute_id' => $positionAttrId[$linkId],
1235-
'value' => $linkPositions[$linkedKey],
1236-
];
1237-
}
1238-
$nextLinkId++;
12391231
}
1232+
if (!empty($linkPositions[$linkedKey])) {
1233+
$positionRows[] = [
1234+
'link_id' => $productLinkKeys[$linkKey],
1235+
'product_link_attribute_id' => $positionAttrId[$linkId],
1236+
'value' => $linkPositions[$linkedKey],
1237+
];
1238+
}
1239+
$nextLinkId++;
12401240
}
12411241
}
12421242
}

0 commit comments

Comments
 (0)