Contents |
eV::userGetAddresses($fieldList,$userId) retrieves an array of stored address data for a particular user. This is useful for building an address book management form, also for presenting address options in a checkout address form page (billing / shipping address entry)
$array = eV::userGetAddresses($fieldList[,$userId]);
Returns a multidimensional array of address data. The first dimension is the index of the address. The second dimension contains the fields that are returned for the address.
Return array is as follows:
Array
(
[0] => Array
(
[addressId] => INT
// POSSIBLE fields returned (as dictated by the $fieldList attribute)
[addressName] => String
[firstName] => String
[lastName] => String
[company] => String
[street1] => String
[street2] => String
[city] => String
[state] => String
[zipCode] => String
[country] => String
[phone1] => String
[phone2] => String
[phone3] => String
[fax] => String
)
[1] => Array...
)
// get addresses $addressArr = eV::userGetAddresses('firstName,lastName,city,state,zipCode'); // display addresses foreach($addressArr as $address) { echo "<hr>" . $address['firstName'] . " " . $address['lastName']; echo "<br>" . $address['city'] . " " . $address['state'] . ", " . $address['zipCode']; };