Adding Multiple Addresses to customer addressbook in PHP
I am using nsLib.php (available from SourceForge) to add customer records and sales orders. I am able to add a single entry to the address book, but I can't figure out how to add more than one at a time:
[PHP]
// Addressbook fields
$A = array("defaultBilling" => "true", "defaultShipping" => "false", "label"=>"111", "addr1"=>"111", "addr2"=>"111", "addressee"=>$addressee, "city"=>$city, "phone"=>$phone, "state" => $state, "zip"=>$zip);
// Second address
$A = array("defaultBilling" => "false", "defaultShipping" => "true", "label"=>"222", "addr1"=>"222", "addr2"=>"222", "addressee"=>$addressee, "city"=>$city, "phone"=>$phone, "state" => $state, "zip"=>$zip);
// Customer fields
$fields = array("entityId"=>$entityId, "companyName"=>$companyName, "isPerson"=>$isPerson, "billPay"=>$billPay, "email"=>$email, "entityId"=>$entityId, "firstName"=>$firstName, "lastName" => $lastName, "homePhone"=>$homePhone, "phone"=>$phone, "fax"=>$fax, "printOnCheckAs" => $printOnCheckAs, "addressBookList"=>(array("addressBook"=>$A, addressBook"=>$B)));
$record_customer = new nsRecord($recordType, $internalId, $fields);
$results_customer = add ($client, $record_customer);
print_r($results_customer);
[/PHP]
This example always adds only $B to the book. I have tried as many variations as I can think of.
How should I do this? What am I missing? Lord have mercy, someone open my eyes!
Thanks in advance.