ePages 6.11.0 - DE_EPAGES/Product/API/Object/LineItemProduct.pm

Package DE_EPAGES::Product::API::Object::LineItemProduct

object interface for LineItemProduct.

Base
DE_EPAGES::Order::API::Object::LineItemSales

Functions

addQuantityToStock
className
dbPackage
getExtraContainerAttributes
getExtraExportableAttributes
grepAvailableShippingMethods
isQuantityCorrectOnInsertOrder
recalculate
set
substractQuantityFromStock

addQuantityToStock

Calls DE_EPAGES::Product::API::Object::Product::addToStock with quantity of lineitem. If the line item contains no product, the stock cant be changed.

Syntax
$LineItemProduct->addQuantityToStock;

className

Returns the class name, used for DAL access.

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

dbPackage

Returns the database package, used for DAL access.

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

getExtraContainerAttributes

Returns names of lineitemcontainer attributes of object for XML export of orders. (e.g. BundleProductContainer)

Syntax
$aAttributes = $Object->getExtraContainerAttributes();
Return
$aAttributes (ref.array.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

grepAvailableShippingMethods

Reduce available shipping methods, if shipping methods selected for product.

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

isQuantityCorrectOnInsertOrder

Calls DE_EPAGES::Product::API::Object::Product::lineItem to get the possible quantity of lineitem. If the line item contains no product the quantity is considered to be available. Returns true if the desired quantity is available and is valid according to the products minimum order amount and order amount interval.

Syntax
$LineItemProduct->isQuantityCorrectOnInsertOrder;
Return
$IsValid (boolean)
true if the quantity is ok

recalculate

Calls DE_EPAGES::Product::API::Object::Product::recalculateLineItem to calculate the line item price based on product price and quantity. Updates the LineItemPrice attribute of the line item.

Syntax
$LineItemProduct->recalculate($Container, $hValues);
Input
$Container (object)
line item container
$hValues (ref.hash)
values that have changed

set

Sets the given attribute values on the object. This function triggers hooks 'OBJ_BeforeUpdateObject' and 'OBJ_AfterUpdateObject' and any specialized OBJ_BeforeUpdate* and OBJ_AfterUpdate* hooks.

Syntax
$Object->set($hValues, $LanguageID);
Example
$Object->set({ 'LocaleID' => 'de_DE' });
$Object->set({ 'Name' => 'Fußball' }, GetPKeyLanguageByCode('de'));
$Object->set({ 'Name' => 'Soccer' }, GetPKeyLanguageByCode('en'));
Input
$hValues (ref.hash)
attribute name => value hash
$LanguageID (integer)
(optional) language id for localized attributes
Hook
OBJ_BeforeUpdateObject
hook parameter keys :
  • Object - this object - object
  • ObjectID - object id - int
  • Values - new values for object - ref.hash
  • LanguageID - values of this language will be updated - int
OBJ_AfterUpdateObject
hook parameter keys :
  • Object - this object - object
  • ObjectID - object id - int
  • Values - updated values - ref.hash
  • LanguageID - values updated of this language - int

substractQuantityFromStock

Calls DE_EPAGES::Product::API::Object::Product::substractFromStock with quantity of lineitem. If the line item contains no product, the stock cant be changed.

Syntax
$LineItemProduct->substractQuantityFromStock;