Contents |
eV::addressesGet returns an array of addresses from both the selected user account and order. For use with offering an address selection for multiple shipping address checkouts.
$array = eV::addressesGet([$fieldList][,$shippingOrPayment][,$orderId][,$userId]);
Multidimensional array with first dimension being the numerical index of the address, second index containing the address field name.
The returned array is as follows (only requested fields via $fieldList will be returned):
Array
(
[0] => Array
(
// always returned
[user_addressId] => INT
[sale_addressId] => INT
// optional elements, as specified in $fieldList
[addressName] => STRING
[firstName] => STRING
[lastName] => STRING
[street1] => STRING
[street2] => STRING
[city] => STRING
[state] => STRING
[zipCode] => STRING
[country] => STRING
[phone1] => STRING
[phone2] => STRING
[phone3] => STRING
[fax] => STRING
[company] => STRING
[title] => STRING
)
[1] => Array ...
)
// get current order, users addresses $arrAddresses = eV::getAddresses('addressName,firstName,lastName'); // output foreach($arrAddresses as $address) echo "<br>" . $address['addressName'] . ": " . $address['firstName'] . " " . $address['lastName'];