Question

someone could tell me if there's an event to observe when i update customer address (shipping and billing)? From frontend and backend. I need it to copy these addresses and putting them into another db.

Thanks.

Was it helpful?

Solution

There is an event called customer_address_save_after which is used for afterAddressSave method in Mage_Customer_Model_Observer class.

OTHER TIPS

Yes there's an event. But it's a dynamic event. So you have to open the file app/code/core/Mage/Core/Model/Abstract.php and put a Mage::log() inside the _beforeSave() function.

abstract class Mage_Core_Model_Abstract extends Varien_Object
    {
       /**
         * Processing object before save data
         *
         * @return Mage_Core_Model_Abstract
         */
        protected function _beforeSave()
        {
            if (!$this->getId()) {
                $this->isObjectNew(true);
            }
            Mage::dispatchEvent('model_save_before', array('object'=>$this));
            Mage::dispatchEvent($this->_eventPrefix.'_save_before', $this->_getEventData());
            // Put a log here.
           Mage::log($this->_eventPrefix.'_save_before',null,'test.log',true);
            return $this;
        }
    }

Then you can figure out the event.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top