Magento 1.4.2 – Set Address Fields During Registration

I am trying to populate address fields during registration, using data from another system. In my observer, I am able to use

$customer = $observer->getCustomer();
$customer->setFirstname($value);
$customer->setLastname($value);

and the information is saved in the database, but

$customer->setStreet($value);
$customer->setPostcode($value);
$customer->setTelephone($value);

do not. How would I set address fields?
Thanks!

2 thoughts on “Magento 1.4.2 – Set Address Fields During Registration”

  1. Addresses are not stored in the Mage_Customer_Model_Customer object. You should instead do something like:

    $address = Mage::getModel('customer/address');
    $address->setStreet(...);
    ...
    $customer->addAddress($address);
    

  2. I found some good posts:
    this was easier for me:-)
    http://www.pauldonnellydesigns.com/blog/magento-display-address-fields-in-create-an-account/
    and longer post:
    http://www.magentocommerce.com/boards/viewthread/11110/

    It’s working, I checked.

    I need show fields form address in orders, controller: /checkout/onepage on the page with form login and register (I want add fields personal and address in step register)

    Do someone saw code to create for this functionality?

Leave a Reply

Your email address will not be published. Required fields are marked *