Created
October 17, 2013 11:41
-
-
Save edannenberg/7023429 to your computer and use it in GitHub Desktop.
Fixes catalogInventoryStockItemUpdate api call (V2) in Magento 1.8. Whats broken: The api method got refactored and now does not call $product->save() anymore. As a result the stock_id for new items is not set as the observer that takes care of that is hooked to the product_save_after event. Fix 1: Apply patch below. *OR* Fix 2: Update db schema…
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- mage_org/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php 2013-10-17 12:24:37.773265017 +0200 | |
+++ src_shop/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php 2013-10-17 13:09:30.141351173 +0200 | |
@@ -54,6 +54,7 @@ | |
/** @var $stockItem Mage_CatalogInventory_Model_Stock_Item */ | |
$stockItem = $product->getStockItem(); | |
+ $stockItem->setStockId($stockItem->getStockId()); | |
$stockData = array_replace($stockItem->getData(), (array)$data); | |
$stockItem->setData($stockData); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment