ePages 7.23.0 - DE_EPAGES/Order/API/Object/CustomerOrder.pm

Package DE_EPAGES::Order::API::Object::CustomerOrder

object interface for CustomerOrder.

Base
DE_EPAGES::Shop::API::Object::ShopObject

Functions

addLineItemContainer
className
clone
container
dbPackage
exportXMLAttributes
getExtraExportableAttributes
getWebUrl
insertLineItem
recalculate
taxAreaDigitalByAddress
updateTaxArea
updateTaxAreaDigital

addLineItemContainer

Adds a line item container to a new order that does not have a line item container. Note: Do not usde this method directly! Use DE_EPAGES::Order::API::Order::CreateOrder instead.

Syntax
$Order->addLineItemContainer( $hValues );
Example
$Order->addLineItemContainer( { 'CurrencyID' => 'USD', 'LocaleID' => 'en_US' } );
Input
$hValues (ref.hash (optional))
  • CurrencyID - (optional; default: user currency or shop default currency) alpha currency code (ISO 4217) - char(3)
  • LocaleID - (optional; default: user locale or shop default locale) locale id - string
  • TaxArea - (optional; default: customer tax area) tax area - DE_EPAGES::Tax::API::Object::TaxArea
  • TaxModel - (optional; default: customer tax model) gross (1) or net (0) price - int
  • Class - (optional; default: LineItemContainer) use custom LineItemContainer class - string
Return
$Order (object)
new customer order

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $CustomerOrder->className;
Return
$ClassName (String)
class name

clone

Inserts a new order into the database as copy from old order.

Syntax
$Clone = $CustomerOrder->clone( $hInfo );
$Clone = $CustomerOrder->clone( $hInfo, $Recursive );
Input
$hInfo (hash ref)
hash with mandatory attribute values.
  • ClassID - class id - int
  • Alias - alias - varchar(255)
  • ParentID - parent objectid - int
  • Inherit - (optional) inherit permissions from parent object - boolean
$Recursive (boolean)
clone child object too (optional, default is false)
Return
$Clone (object)
the new object

container

Returns the line item container of the order.

Syntax
$LineItemContainer = $CustomerOrder->container;
Return
$LineItemContainer (DE_EPAGES::Order::API::Object::LineItemContainer)
line item container

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $CustomerOrder->dbPackage;
Return
$DbPackage (String)
database package name

exportXMLAttributes

Returns plain attributes of object to XML export driver. This function removes bit attributes with value 0.

Syntax
$hAttributes = $Object->exportXMLAttributes( $Driver, $hAllAttributes );
Input
$Driver (object)
xml export driver with support function addObject
$hAllAttributes (ref.hash)
all attributes of object,
see $Object->exportableAttributes
Return
$hAttributes (ref.hash.string)
plain attributes

getExtraExportableAttributes

Returns names of attributes of object for XML export of orders.

Syntax
$aAttributes = $Object->getExtraExportableAttributes();
Return
$aAttributes (ref.array.string)
plain attributes

getWebUrl

Construct the web url of a given object dependend of the following parameters:

Syntax
$WebUrl = $Object->getWebUrl($hParams);
Input
$hParams (hash ref)
attributes of new object
  • SSL - SSL web url - boolean
  • Section - Storefront | Mobile | Admin - string
Return
$WebUrl (string)
web url of the object

insertLineItem

Insert a lineItem in to container, see DE_EPAGES::Order::API::Object::LineItemContainer::insertLineItem.

Syntax
$CustomerOrder->insertLineItem;
Input
@Parameter (array)
list of parameters that define a line item

recalculate

Recalculate lineitem container, see DE_EPAGES::Order::API::Object::LineItemContainer::recalculate.

Syntax
$CustomerOrder->recalculate;
Input
@Parameter (array)
list of parameters to be changed

taxAreaDigitalByAddress

Get the order tax area digital based on the shipping address country Default tax area digital is the tax area based on the shop address Returns the tax area digital for the order, or undef if the address isn't in the EU

Syntax
$TaxAreaDigital = $Order->taxAreaDigitalByAddress();
Return
$TaxAreaDigital (object)
tax area digital object

updateTaxArea

Updates the tax area of the order based on the shipping address. Sets the tax are to the customer tax area if a tax area is explicitely for the customer. Note: After $CustomerOrder->updateTaxArea you must call $CustomerOrder->recalculate to update the price calculation.

Syntax
$CustomerOrder->updateTaxArea;
Example
$CustomerOrder->set({'ShippingAddress' => $NewShippingAddress});
if( $CustomerOrder->updateTaxArea ) {
    $CustomerOrder->recalculate;
}
Return
$TaxChanged (boolean)
true if tax area has changed, otherwise undef

updateTaxAreaDigital

Sets the order tax area digital based on the shipping address country Default tax area digital is the tax area based on the shop address Returns true, if calculation of tax has changed, because of changed country in billing or shipping address

Syntax
$TaxDigitalChanged = $CustomerOrder->updateTaxAreaDigital();
Return
$TaxDigitalChanged (boolean)
true if tax area or tax calculation has changed,
otherwise undef