i have a customer attribute with id: mobile, which is a required field in account creation. i want an observer to copy mobile attribute value into Magento default _address_telephone attribute automatically on account creation.

how should its observer.php and config.xml be?

I did it for product attribute this way: How to copy a product's attributes value to another attribute?

  • Did you try out Jeroen's solution? It should work Commented Jun 27, 2015 at 13:32

1 Answer 1


Your observer should have a function

public function moveMobileTo($observer) {
    $customer = $observer->getCustomer();

    // If you mean this, the next line applies
    $customer->setData('_address_telephone', $customer->getData('mobile'));

    // If you mean this, the next line applies
    $address = $customer->getPrimaryBillingAddress();
    $address->setData('telephone', $customer->getData('mobile'));

You should listen to the customer_save_before event.


<?xml version="1.0"?>

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.