Get a old Email in customer_save_before
i need get a old email and compare with a new email using customer_save_before event
Test to listen customer_save_before event, getData('email') return a new email and getOrigData('email') not work
Test me too with customer_save_after and not work开发者_开发问答, getOrigData('email ') return 1 and getData('email') return a new email.
is there any way to tell which is the email that was changed?
use: magento-1.4.0.1
Thanks
In the customer_save_before, the old data should still be present in the DB, so you could try getting the customer from the model based on id:
$old_email = Mage::getModel('customer/customer')->load($customer->getId())->getEmail();
The above line of code assumes that you $customer is the customer object you get from the event.
If my reasoning is correct the retrieved customer data should contain the old email address.
精彩评论