File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,15 @@ public function update($productId, $data)
35
35
$ idBySku = $ product ->getIdBySku ($ productId );
36
36
$ productId = $ idBySku ? $ idBySku : $ productId ;
37
37
38
- $ product ->setStoreId ($ this ->_getStoreId ())
39
- ->load ($ productId );
38
+ /** @var Mage_CatalogInventory_Model_Stock_Item $stockItem */
39
+ $ stockItem = Mage::getModel ('cataloginventory/stock_item ' )
40
+ ->setStoreId ($ this ->_getStoreId ())
41
+ ->loadByProduct ($ productId );
40
42
41
- if (!$ product ->getId ()) {
43
+ if (!$ stockItem ->getId ()) {
42
44
$ this ->_fault ('not_exists ' );
43
45
}
44
46
45
- $ stockItem = $ product ->getStockItem ();
46
47
$ stockData = array_replace ($ stockItem ->getData (), (array )$ data );
47
48
$ stockItem ->setData ($ stockData );
48
49
You can’t perform that action at this time.
0 commit comments