Skip to content

Commit 81be7cf

Browse files
committed
ACP2E-412: Cant link configurable options with REST to product created on Backend
1 parent e020c0d commit 81be7cf

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

app/code/Magento/ConfigurableProduct/Model/OptionRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public function save($sku, OptionInterface $option)
239239
if (!$option->getId()) {
240240
throw new CouldNotSaveException(__('An error occurred while saving the option. Please try to save again.'));
241241
}
242-
return $option->getId();
242+
return $option->getId()."ooo".$product->getTypeId();
243243
}
244244

245245
/**

dev/tests/api-functional/testsuite/Magento/ConfigurableProduct/Api/OptionRepositoryTest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,13 @@ public function testAdd(): void
190190
]
191191
],
192192
];
193-
/** @var int $result */
193+
/** @var string $result */
194194
$result = $this->_webApiCall($serviceInfo, ['sku' => $productSku, 'option' => $option]);
195-
$this->assertEquals('configurable', $product->getTypeId());
196-
$this->assertGreaterThan(0, $result);
195+
$updatedproduct = $productRepository->get($productSku);
196+
$this->assertEquals('configurable', $updatedproduct->getTypeId());
197+
$arr = explode("000", $result);
198+
$this->assertEquals('configurable', $arr[1]);
199+
//$this->assertGreaterThan(0, $result);
197200
}
198201

199202
/**

0 commit comments

Comments
 (0)