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.
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityThere is an event called customer_address_save_after
which is used for afterAddressSave
method in Mage_Customer_Model_Observer
class.
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.
customer_address_save_before
andcustomer_address_save_after
you can use any of them