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.

Mex
  • 386
  • 1
  • 6
  • 16
  • Ah found it:

    http://magento.stackexchange.com/questions/36056/where-is-catalog-product-save-before-dispatched

    – Mex Feb 10 '15 at 13:25

1 Answers1

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());
Marius
  • 197,939
  • 53
  • 422
  • 830