ePages 6.17.52 - DE_EPAGES/Order/API/BasketAddress.pm

Package DE_EPAGES::Order::API::BasketAddress

Sets billing and shipping address in the basket

Functions

CheckBasketAddress
GetPKeyCountryByCode2
LoadRootObject
Transaction
new
removeAddress
setAddress

CheckBasketAddress

Checks if all required address data has been entered according to the particular registration set (non-member or shipping address). Adds a form error for each input field that is not correctly filled in. Used at storefront and from webservice.

Syntax
my $hAddress = CheckBasketAddress($Form, $Basket, $AddressType, $UsesShipping);
Input
$Form (object)
form object
$Basket (object)
basket object
$AddressType (object)
address type
$UsesShipping (boolean)
true if shipping address is given
Return
$hAddress (ref.hash)
shipping or billing address values

GetPKeyCountryByCode2

Returns primary key of Country by alternate key Code2.

Syntax
$CountryID = GetPKeyCountryByCode2($Code2);
Input
$Code2 (char(2))
country iso code alpha 2
Return
$CountryID (int)
country identifier - iso num code (primary key)

LoadRootObject

Returns the root object.

Syntax
$Object = LoadRootObject();
Return
$Object (object)
root object

Transaction

Runs a code block in a transaction using the current database handle. If an error occurs, the local data cache is reset and the code block $cRollback is executed.

Syntax
Transaction( $cCode, $cRollback );
Input
$cCode (code reference)
code block
$cRollback (code reference)
roll back code block (optional)

new

Constructor

Syntax
new( $Basket );
Input
$Basket (DE_EPAGES::Order::API::Object::Basket)
basket
Return
$self (DE_EPAGES::Order::API::BasketAddress)
self

removeAddress

Deletes the address of the given type from the basket.

Syntax
removeAddress( $AddressTypePrefix );
Input
$AddressTypePrefix (String)
prefix of address type (Billing or Shipping)

setAddress

Sets the address of the given address type in the basket.

Syntax
setAddress( $hAddressData, $AddressTypePrefix );
Input
$hAddressData (ref_hash)
the address data
$AddressTypePrefix (String)
prefix of address type (Billing or Shipping)