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

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

object interface for CustomerOrder.

Base
DE_EPAGES::Object::API::Object::Object

Functions

addLineItemContainer
className
clone
container
dbPackage
exportXMLAttributes
getExtraExportableAttributes
insertLineItem
recalculate
updateTaxArea

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)
  • LanguageID - (optional; default: language from LocaleID) language id - int
  • 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

insertLineItem

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

Syntax
$CustomerOrder->insertLineItem;

recalculate

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

Syntax
$CustomerOrder->recalculate;

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