0

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.

1
  • there are two observer customer_address_save_before and customer_address_save_after you can use any of them
    – Keyul Shah
    Commented Feb 5, 2014 at 12:08

2 Answers 2

0

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

0

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.

2
  • I don't understand, what i have to log! what's the argument of Mage::log() ?
    – giovanni
    Commented Feb 5, 2014 at 13:39
  • Updated the answer
    – Sukeshini
    Commented Feb 5, 2014 at 16:01

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.