1

What is the event name for when a new product is added?

I have looked here:

http://blog.chapagain.com.np/magento-event-observer-with-save-before-and-save-after/

But catalog_product_save_before doesn't seem to be on any Magento event list for 1.7, 1.8 or 1.9.

1

1 Answer 1

3

I can confirm that catalog_product_save_before works on every magento version.

You don't find it because there is no explicit call to Mage::dispatchEvent('catalog_product_save_before', ....).
The event is dispatched in Mage_Core_Model_Abstract::_beforeSave() through the line

Mage::dispatchEvent($this->_eventPrefix.'_save_before', $this->_getEventData());

the product model extends Mage_Core_Model_Abstract and the original _beforeSave method is called. In the product case $this->_eventPrefix has the value catalog_product. Check the class Mage_Catalog_Model_Product to see for yourself.

So you actually get

Mage::dispatchEvent('catalog_product_save_before', $this->_getEventData());
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.