1

I am trying to change "Stock Availability" tab inside "Inventory" tab for configurable product by calling Magento Rest API with standard url.

I see that while calling PUT option to change "Stock Availability", it realized that it calls $stock-save() which in-turn calls _afterSave().

When I see inside this _afterSave function, I see that if I run API for simple product, it run through but if it is configurable product, it struck at parent::_afterSave();.

Just for test purpose, when I commented "parent::_afterSave();" line, it worked beautifully.

Can someone please advise on what am I missing because the same function must be called when we manually save product by going to Magento Dashboard -> Catalog -> Products

[EDIT] : I thought to put code available inside _afterSave():

    protected function _afterSave()
{

parent::_afterSave();

/** @var $indexer Mage_Index_Model_Indexer */
$indexer = Mage::getSingleton('index/indexer');
if ($this->_processIndexEvents) {
$indexer->processEntityAction($this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE);
} else {
$indexer->logEvent($this, self::ENTITY, Mage_Index_Model_Event::TYPE_SAVE);
}
return $this;
}

Your help is really appreciated.

Ashish

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.