Shop_CheckoutAddressInfo class
Defined in |
/modules/shop/classes/shop_checkoutaddressinfo.php, lines 12-366 |
Author |
LemonStand eCommerce Inc. |
Represents a customer shipping or billing address which the customer provides during the checkout process.
Normally you don't need to create instances of that class. LemonStand provides the access to the class object
during the checkout process. Please refer to the shop:checkout action description for details.
Property |
Type |
Description |
Defined By |
city |
string |
specifies the customer's city name. |
Shop_CheckoutAddressInfo |
company |
string |
specifies the customer's company name. |
Shop_CheckoutAddressInfo |
country |
integer |
specifies the country identifier. |
Shop_CheckoutAddressInfo |
email |
string |
specifies the customer's email address. |
Shop_CheckoutAddressInfo |
first_name |
string |
specifies the customer's first name. |
Shop_CheckoutAddressInfo |
is_business |
boolean |
indicates whether the object represents a business address. |
Shop_CheckoutAddressInfo |
last_name |
string |
specifies the customer's last name. |
Shop_CheckoutAddressInfo |
phone |
string |
specifies the customer's phone number. |
Shop_CheckoutAddressInfo |
state |
integer |
specifies the state identifier. |
Shop_CheckoutAddressInfo |
street_address |
string |
specifies the customer's street address. |
Shop_CheckoutAddressInfo |
zip |
string |
specifies the customer's ZIP or postal code. |
Shop_CheckoutAddressInfo |
Method |
Description |
Defined By |
as_string() |
returns the address information as a formatted address string. |
Shop_CheckoutAddressInfo |
copy_from() |
copies the address from another Shop_CheckoutAddressInfo object. |
Shop_CheckoutAddressInfo |
equals() |
checks whether the address represented with the object matches the address represented with another address information object. |
Shop_CheckoutAddressInfo |
load_from_customer() |
loads address information from a customer object. |
Shop_CheckoutAddressInfo |
save_to_customer() |
saves address information to a customer object. |
Shop_CheckoutAddressInfo |
save_to_order() |
saves address information to an order object. |
Shop_CheckoutAddressInfo |
set_from_default_shipping_location() |
loads the object properties from default shipping location. |
Shop_CheckoutAddressInfo |
set_from_post() |
loads the object properties from POST parameters. |
Shop_CheckoutAddressInfo |
set_location() |
sets country, state and ZIP codes. |
Shop_CheckoutAddressInfo |
Property details
¶
city property
public string $city;
Specifies the customer's city name.
¶
company property
public string $company;
Specifies the customer's company name.
¶
country property
public integer $country;
Specifies the country identifier.
Note that this property contains a country identifier,
not a reference to a country object. To load the country object and output its name use the following code:
$country = Shop_Country::find_by_id($address_info->country);
if ($country)
echo h($country->name);
¶
email property
public string $email;
Specifies the customer's email address.
¶
first_name property
public string $first_name;
Specifies the customer's first name.
¶
is_business property
public boolean $is_business;
Indicates whether the object represents a business address.
¶
last_name property
public string $last_name;
Specifies the customer's last name.
¶
phone property
public string $phone;
Specifies the customer's phone number.
¶
state property
public integer $state;
Specifies the state identifier.
Note that this property contains a state identifier,
not a reference to a state object. To load the state object and output its name use the following code:
$state = Shop_CountryState::find_by_id($address_info->state);
if ($state)
echo h($state->name);
¶
street_address property
public string $street_address;
Specifies the customer's street address.
¶
zip property
public string $zip;
Specifies the customer's ZIP or postal code.
Method details
¶
as_string() method
public string as_string()
{return} |
string |
returns the address as string. |
Returns the address information as a formatted address string.
¶
copy_from() method
public void copy_from(Shop_CheckoutAddressInfo $address)
$address |
Shop_CheckoutAddressInfo |
specifies the address information object to copy the address from. |
Copies the address from another Shop_CheckoutAddressInfo object.
¶
equals() method
public boolean equals(Shop_CheckoutAddressInfo $address_info)
$address_info |
Shop_CheckoutAddressInfo |
specifies another address information object to compare with. |
{return} |
boolean |
returns TRUE if the address matches. Returns FALSE otherwise. |
Checks whether the address represented with the object matches the address represented with another address information object.
¶
load_from_customer() method
$customer |
Shop_Customer |
specifies a customer object to load address information from. |
Loads address information from a customer object.
¶
save_to_customer() method
$customer |
Shop_Customer |
specifies a customer object to save address information to. |
Saves address information to a customer object.
The method doesn't save the customer object to the database.
¶
save_to_order() method
$order |
Shop_Order |
specifies an order object to save address information to. |
Saves address information to an order object.
The method doesn't save the order object to the database.
¶
set_from_default_shipping_location() method
public void set_from_default_shipping_location()
Loads the object properties from default shipping location.
The default shipping location can be configured on Shipping Configuration page.
¶
set_from_post() method
$customer |
Shop_Customer |
specifies the customer object if it is presented. |
Loads the object properties from POST parameters.
The POST parameter names should match the class property names.
¶
set_location() method
public void set_location(integer $country_id, integer $state_id, string $zip)
$country_id |
integer |
specifies the country identifier. |
$state_id |
integer |
specifies the state identifier. |
$zip |
string |
specifies the ZIP or postal code. |
Sets country, state and ZIP codes.
|