Friday 4 July 2014

How to Create new Customer billing and shipping address

$_custom_address = array (
    'firstname' => 'Sanjay',
    'lastname' => 'Rao',
    'street' => array (
        '0' => 'Line address part1',
        '1' => 'Line address part2',
    ),
    'city' => 'Ahemdabad',
    'region_id' => '',
    'region' => '',
    'postcode' => '380015',
    'country_id' => 'IN', /*India */
    'telephone' => '1234567890',
);
$customAddress = Mage::getModel('customer/address')
$customAddress->setData($_custom_address)
            ->setCustomerId($customer->getId())
            ->setIsDefaultBilling('1')
            ->setIsDefaultShipping('1')
            ->setSaveInAddressBook('1');
try {
    $customAddress->save();
}
catch (Exception $ex) {
    //Zend_Debug::dump($ex->getMessage());
}

No comments:

Post a Comment

List OF BANK PAN Numbers

List OF BANK PAN Numbers Bank/Home Loan Providers PAN Number Allahabad Bank AACCA8464F Andhra Bank AABCA7375C Axis Bank...