Skip to content

Commit e80b162

Browse files
author
Alexey Yakimovich
committed
MAGETWO-70232: [GITHUB] Import customizable options adds it to another product if same SKU is filled#9457
- Fixed integration test related issue;
1 parent a72ce12 commit e80b162

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/code/Magento/Catalog/Model/Product/Option/SaveHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public function execute($entity, $arguments = [])
5858
}
5959
}
6060
if ($options) {
61-
$hasChangedSku = $entity->dataHasChangedFor('sku');
61+
$hasChangedSku = ($entity->getOrigData('sku') !== null && $entity->dataHasChangedFor('sku'));
6262
foreach ($options as $option) {
63-
if ($hasChangedSku) {
63+
if ($hasChangedSku && $option->hasData('product_sku')) {
6464
$option->setProductSku($entity->getSku());
6565
}
6666
$this->optionRepository->save($option);

0 commit comments

Comments
 (0)