Discussions
Add New Item in Addressbook
Anyone help me.I have an array with test data. I need to check that in addressbook and if it not exists then add in list please help me. I have some code but it create some exception.
Code:
$addrArray = array
(
"defaultBilling" => false,
"defaultShipping" => false,
"addr1" => 'Street No 1, ',
"addr2" => '',
"label" => "Test address",
"city" => "Test",
"phone" => "0923456789014",
"country" => "CN",
"addressee" => "Test Addressee",
"zip" => '123456'
);
$CustomerAddressBook = new nsComplexObject('CustomerAddressbook');
$CustomerAddressBook->setFields($addrArray);
$addResponse = $myNSclient->add($CustomerAddressBook);
If anyone have some idea please tell me.
Thanks in advance.