Skip to content

Commit 3597177

Browse files
author
Michail Slabko
committed
MAGETWO-39872: Unable to update "title", "type", "price", "price_type" in product options through API
1 parent fd7abdf commit 3597177

File tree

1 file changed

+14
-16
lines changed
  • app/code/Magento/Catalog/Model/ResourceModel/Product

1 file changed

+14
-16
lines changed

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

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,21 @@ protected function _saveValuePrices(\Magento\Framework\Model\AbstractModel $obje
119119
$optionId = $connection->fetchOne($statement);
120120

121121
if ($optionId) {
122-
if ($object->getStoreId() == '0') {
123-
$data = $this->_prepareDataForTable(
124-
new \Magento\Framework\DataObject(
125-
['price' => $object->getPrice(), 'price_type' => $object->getPriceType()]
126-
),
127-
$priceTable
128-
);
122+
$data = $this->_prepareDataForTable(
123+
new \Magento\Framework\DataObject(
124+
['price' => $object->getPrice(), 'price_type' => $object->getPriceType()]
125+
),
126+
$priceTable
127+
);
129128

130-
$connection->update(
131-
$priceTable,
132-
$data,
133-
[
134-
'option_id = ?' => $object->getId(),
135-
'store_id = ?' => \Magento\Store\Model\Store::DEFAULT_STORE_ID
136-
]
137-
);
138-
}
129+
$connection->update(
130+
$priceTable,
131+
$data,
132+
[
133+
'option_id = ?' => $object->getId(),
134+
'store_id = ?' => \Magento\Store\Model\Store::DEFAULT_STORE_ID
135+
]
136+
);
139137
} else {
140138
$data = $this->_prepareDataForTable(
141139
new \Magento\Framework\DataObject(

0 commit comments

Comments
 (0)