Magento – Event for Adding a New Product

event-observer

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.

Best Answer

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());