ePages 6.17.12 - DE_EPAGES/Order/API/Basket.pm

Package DE_EPAGES::Order::API::Basket

This package provides the main basket functions.

@EXPORT_OK
CheckBasketAddress
CreateBasket
GetExistingBasket
GetBasket
IsFiscalCodeRequired

Functions

CheckBasketAddress
CreateBasket
GetBasket
GetExistingBasket
IsFiscalCodeRequired

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

CreateBasket

Creates a basket for a user and shop.

Syntax
$Basket = CreateBasket($hInfo);
Input
$hInfo (ref.hash)
keys
  • User - user - object
  • Shop - shop - object
  • LocaleID - Locale - char(5)
  • Parent - baskets folder (optional) - object
Return
$Basket (object)
basket

GetBasket

Creates a basket for a user if the basket does not exist
else it returns the existing basket.

Syntax
$Basket = GetBasket($User, $Shop, $hInfo);
Input
$User (object)
user
$Shop (object)
shop
$hInfo (ref.array.hash)
basket infos keys (optional):
  • LocaleID | Locale (optional) | char(5)
  • CurrencyID | currency (optional) | char(3)
  • Parent - baskets folder (optional) - object
Return
$Basket (object)
basket

GetExistingBasket

Gets a basket for a user in a shop if the basket exists else it returns 'undef'.

Syntax
$Basket = GetExistingBasket($User, $Shop, $hInfo);
Input
$User (object)
user
$Shop (object)
shop
$hInfo (ref.hash)
keys
  • Parent - baskets folder (optional) - object
Return
$Basket (object)
basket (optional)

IsFiscalCodeRequired

returns true if exception for Italy EPG-21131 is true

Syntax
$required = IsFiscalCodeRequired( $Basket, $AddressType, $BasketCountryID );
Input
$Basket (object)
basket object
$AddressType (string)
address type
$BasketCountryID (int)
country id from the basket address
Return
$required (int)
true if required