I need some help.
I have added a custom attribute to the cataloginventory/stockitem table and now I am trying to observe the cataloginventory_stock_item_save_before event to set my custom attribute before saving.
<global>
<events>
<cataloginventory_stock_item_save_before>
<observers>
<mypackage_mymodule_stocknote>
<type>singleton</type>
<class>Mypackage_Mymodule_Model_Observer</class>
<method>stocknote</method>
</mypackage_mymodule_stocknote>
</observers>
</cataloginventory_stock_item_save_before>
</events>
</global>
This should be triggered every time a stock_item model is saved, thus when an order is placed or when a product saved, right?
I am testing the observer with a print and die command, but it doesn't look like my observer is executed. To add to the confusion, it works fine, with the same configuration, if I call cataloginventoriy_stock_item_save_after
event instead.
Anyone got a hint for me what I am doing wrong? I need to set some custom attribute in the stock_item before it is saved, alternate approaches also welcome.
cataloginventory_stock_item_save_after
is also not reliable, see magento.stackexchange.com/questions/25207/…