Skip to content
Snippets Groups Projects
Commit 1d37cce4 authored by nmalevanec's avatar nmalevanec
Browse files

6486: magento/magento2#6486: Unable to save certain product properties via Rest API

parent 9db02736
No related merge requests found
...@@ -329,7 +329,7 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa ...@@ -329,7 +329,7 @@ class ProductRepository implements \Magento\Catalog\Api\ProductRepositoryInterfa
unset($productData['media_gallery']); unset($productData['media_gallery']);
if ($createNew) { if ($createNew) {
$product = $this->productFactory->create(); $product = $this->productFactory->create();
if (!isset($productData['product_type'])) { if (isset($productData['price']) && !isset($productData['product_type'])) {
$product->setTypeId(Product\Type::TYPE_SIMPLE); $product->setTypeId(Product\Type::TYPE_SIMPLE);
} }
if ($this->storeManager->hasSingleStore()) { if ($this->storeManager->hasSingleStore()) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment