I have an module A will save a product using
$product->save();
This module will run in cron job.
And another module B has
<catalog_product_save_after>
<observers>
<warehouse_save_product_batch_special_prices>
<class>warehouse/catalog_product_price_observer</class>
<method>saveBatchSpecialPrices</method>
</warehouse_save_product_batch_special_prices>
</observers>
</catalog_product_save_after>
Anyone know module A will or will not trigger module B function?
Best Answer
Yes, definitely, if you check the
save
function ofMage_Core_Model_Abstract
you can see this:This line:
$this->_beforeSave();
triggers the following events:model_save_before
$this->_eventPrefix.'_save_before'
where the event prefix depends on your model. In your case, it iscatalog_product
On the other hand, this line:
$this->_afterSave()
triggers the following events:model_save_after
$this->_eventPrefix.'_save_after'
(same remark as before)