RSS

Adding address programmatically in magento

10 Jul
$addressData =  array (
                    [prefix] => test
                    [firstname] => test
                    [middlename] => test
                    [lastname] => test
                    [suffix] => tes
                    [company] => test
                    [street] => 34
24
                    [city] => 234
                    [country_id] => US
                    [region] => Alabama
                    [region_id] => 1
                    [postcode] => 234
                    [telephone] => 234
                    [fax] => 234
                    [is_default_billing] => 1
                    [is_default_shipping] => 
                );
 
 $customer = Mage::getModel('customer/customer');
 $customer->loadByEmail('test@test.com');
 $address   = Mage::getModel('customer/address');
 $address->addData($addressData);
 $customer->addAddress($address);

 $customer->save();

 

Advertisements
 
2 Comments

Posted by on July 10, 2013 in Magento

 

Tags:

2 responses to “Adding address programmatically in magento

  1. body shapers

    July 14, 2013 at 12:55 am

    It’s an amazing article for all the online users; they will obtain benefit from it I am sure.

     
  2. Redunovin

    July 30, 2013 at 11:46 pm

    Excellent post. I was checking constantly this blog
    and I am impressed! Extremely useful info specially the last part 🙂 I care for such info much.
    I was looking for this certain info for a very long time.

    Thank you and good luck.

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: