ePages 6.10 - DE_EPAGES/Order/API/Object/LineItem.pm

Package DE_EPAGES::Order::API::Object::LineItem

object interface for LineItem.

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

Functions

addMailParams
className
clearMail
container
dbPackage
formatter
globalKeys
grepAvailableShippingMethods
recalculate
template

addMailParams

allow to change email params for CustomerOrderConfirmation mail

Syntax
$LineItem->addMailParams($hParams,$hRegionalParams);
Example
my $LineItems = $Order->get('LineItemContainer')->get('Positions');
$_->addMailParams(\%MailParams, \%RegionalParams) foreach @$LineItems;
Input
$hParams (ref.hash:)
MailParams
$hRegionalParams (ref.hash)
RegionalParams

className

Returns the class name, used for DAL access.

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

clearMail

cleanup data from addMailParams

Syntax
$LineItem->clearMail($hParams,$hRegionalParams);
Example
my $LineItems = $Order->get('LineItemContainer')->get('Positions');
$_->clearMail(\%MailParams, \%RegionalParams) foreach @$LineItems;
Input
$hParams (ref.hash:)
MailParams
$hRegionalParams (ref.hash)
RegionalParams

container

Returns the container of this item (most parent).

Syntax
$Container = $LineItem->container;
Return
$container (LineItemContainer)
line item container

dbPackage

Returns the database package, used for DAL access.

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

formatter

Returns the formatter (and rounder) of this line item.

Syntax
$Formatter = $LineItem->formatter;
Example
$self->formatter->round($BasePrice * $Discount / -100),
Return
$Formatter (MoneyFormatter)
line item container ($self->container->formatter)

globalKeys

Returns list of keys. The lineitemprice depends on this, only keys are returned which are saved at lineitemcontainer and basket or order. If your line item has more external dependencies, overwrite this function.

Syntax
@Keys = __PACKAGE__->globalKeys;
@Keys = $LineItem->globalKeys;
Return
@Keys (array.string)
list of attributes names (TaxArea User Customer CurrencyID TaxModel)

grepAvailableShippingMethods

Empty methode to allow products to reduce available shipping methods.

Syntax
$aShippingMethods = $LineItem->grepAvailableShippingMethods($aShippingMethods);
Input
$aShippingMethods (ref.array.object)
shipping methods
Return
$aShippingMethods (ref.array.object)
selected shipping methods

recalculate

This standard recalculate function save the given values in database. This method should be used for other more specific line items to recalculate their prices and taxes.

Syntax
$LineItem->recalculate($Container, $hValues);
Input
$Container (object)
line item container
$hValues (ref.hash)
values which will be changed

template

This function is used to overwrite the given template for the purpose that each lineitem can defined there own template (visualisation).

Syntax
$Name = $Object->template($Name, $ObjectPageType);
Input
$Name (string)
include name
$ObjectPageType (DE_EPAGES::Presentation::API::Object::ObjectPageType)
object related pagetype
Return
$Name (string)
include name