Skip to content

Commit 1d37cce

Browse files
committed
6486: #6486: Unable to save certain product properties via Rest API
1 parent 9db0273 commit 1d37cce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Model/ProductRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ protected function initializeProductData(array $productData, $createNew)
329329
unset($productData['media_gallery']);
330330
if ($createNew) {
331331
$product = $this->productFactory->create();
332-
if (!isset($productData['product_type'])) {
332+
if (isset($productData['price']) && !isset($productData['product_type'])) {
333333
$product->setTypeId(Product\Type::TYPE_SIMPLE);
334334
}
335335
if ($this->storeManager->hasSingleStore()) {

0 commit comments

Comments
 (0)