I am using customer_address_save_after
event to check do stuff when a customer address has been changed/edited.
I need to somehow prevent the execution of my code if the address hasn't changed. This is because the customer_address_save_after
event fires on save customer which might mean the address hasn't been changed but a different customer config setting.
Here is what I have tried so far:
I set the $address
variable with getData()
and $orig_address
with getOrigData()
I then want to check if the data has changed since the last save
if($address != $orig_address && $orig_address['updated_at'] < $address['updated_at']){
Do stuff...
}
I have done some searching and seen that there is a _hasDataChanges()
method but I've never used it and cannot find any examples of it's use...
Any suggestions are welcomed
UPDATE
I've accessed the _hasDataChanges()
method which is always going to be true if the save event fires due to the updated_at
customer attribute.
I need to find a way to exclude that part of the data from the check...