Difference between revisions of "Functions:addressesGet"
From Whirlwind eCommerce Wiki
(New page: == Description == 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 che...) |
(changes shippingOrBilling to shippingOrPayment) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
== Syntax == | == Syntax == | ||
− | $array = eV::addressesGet([$ | + | $array = eV::addressesGet([$fieldList][,$shippingOrPayment][,$orderId][,$userId]); |
== Paramaters == | == Paramaters == | ||
− | * | + | *fieldList STRING OPTIONAL |
:: comma-delimited list of address fields. user_addressId and sale_addressId will automatically be included. Available address fields: | :: comma-delimited list of address fields. user_addressId and sale_addressId will automatically be included. Available address fields: | ||
::*addressName | ::*addressName | ||
Line 23: | Line 23: | ||
::*title | ::*title | ||
::*company | ::*company | ||
− | * | + | *shippingOrPayment BIT OPTIONAL |
− | :: | + | :: 0 = only shipping addresses from order, 1 = only billing addresses from order, NULL = both |
+ | *orderId INT OPTIONAL | ||
+ | :: unique orderId for visitor's shopping cart | ||
*userId INT OPTIONAL | *userId INT OPTIONAL | ||
:: unique userId for user's addresses to be returned | :: unique userId for user's addresses to be returned | ||
Line 66: | Line 68: | ||
// get current order, users addresses | // get current order, users addresses | ||
$arrAddresses = eV::getAddresses('addressName,firstName,lastName'); | $arrAddresses = eV::getAddresses('addressName,firstName,lastName'); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// output | // output | ||
foreach($arrAddresses as $address) echo "<br>" . $address['addressName'] . ": " . $address['firstName'] . " " . $address['lastName']; | foreach($arrAddresses as $address) echo "<br>" . $address['addressName'] . ": " . $address['firstName'] . " " . $address['lastName']; | ||
</source> | </source> |
Latest revision as of 17:54, 25 May 2009
Description
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.
Syntax
$array = eV::addressesGet([$fieldList][,$shippingOrPayment][,$orderId][,$userId]);
Paramaters
- fieldList STRING OPTIONAL
- comma-delimited list of address fields. user_addressId and sale_addressId will automatically be included. Available address fields:
- addressName
- firstName
- lastName
- street1
- street2
- city
- state
- zipCode
- country
- phone1
- phone2
- phone3
- fax
- title
- company
- comma-delimited list of address fields. user_addressId and sale_addressId will automatically be included. Available address fields:
- shippingOrPayment BIT OPTIONAL
- 0 = only shipping addresses from order, 1 = only billing addresses from order, NULL = both
- orderId INT OPTIONAL
- unique orderId for visitor's shopping cart
- userId INT OPTIONAL
- unique userId for user's addresses to be returned
Return Values
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 ... )
Examples
- Basic use example
// get current order, users addresses $arrAddresses = eV::getAddresses('addressName,firstName,lastName'); // output foreach($arrAddresses as $address) echo "<br>" . $address['addressName'] . ": " . $address['firstName'] . " " . $address['lastName'];