ePages 7.28.0 - DE_EPAGES/Colissimo/API/Tools.pm

Package DE_EPAGES::Colissimo::API::Tools

This package provides the Colissimo global functionality.

@EXPORT_OK
IsHomeDelivery
GetProductLineItemWeightInGram
GetDeliveryBasketData
HasBasketChanged
GetTransactionPath
GetLabelPath
GetTransactionPath

Functions

GetDeliveryBasketData
GetLabelPath
GetProductLineItemWeightInGram
GetTransactionPath
HasBasketChanged
IsHomeDelivery

GetDeliveryBasketData

returns values basket required for the redirection

Syntax
GetDeliveryBasketData( $Basket );
Input
$Basket (Object)
basket object
Return
%hDiliveryBasketData (hash)
values like deliveryPeriod or weightInGram

GetLabelPath

returns the path for the stored file of a shipping label

Syntax
$Path = GetLabelPath($ShippingLabel,$FileExtension);
Example
my $Path  = GetLabelPath($ShippingLabel,'txt');
Input
#ShippingLabel (object)
shipping label object
#FileExtension (string)
file extension
Return
#Path (string)
path and file name

GetProductLineItemWeightInGram

Converts the weight of a given ProductLineItem into gram

Syntax
GetProductLineItemWeightInGram($LineItem);
Example
GetProductLineItemWeightInGram($LineItem);
Input
$LineItem (object)
product line item
Return
returns the weight in gram

GetTransactionPath

returns the path for the exported file of a transaction

Syntax
$Path = GetTransactionPath($Transaction, $FileExtension);
Example
my $Path  = GetTransactionPath($Transaction, 'gif');
Input
$Transaction (object)
transaction object
FileExtension (string)
export file extension
Return
Path (string)
path and export name

HasBasketChanged

Returns true if the calculated shipping price or weight differs from the Basket values ColissimoCalculationUsedPrice / ColissimoCalculationUsedWeight

Syntax
HasBasketChanged( $LineItem );
Input
$LineItem (DE_EPAGES::Order::API::Object::LineItemShipping)
shipping lineitem
Return
$IsChanged (boolean)
true if values differ

IsHomeDelivery

Logs a structure to the communication.log.

Syntax
IsHomeDelivery($DeliveryMode);
Example
IsHomeDelivery('DOM');
Input
$DeliveryMode (string)
name of delivery mode
Return
returns true if delivery mode is DOM, RDV