ePages 6.11.0 - DE_EPAGES/ProductPortal/API/Export.pm

Package DE_EPAGES::ProductPortal::API::Export

API functions needed for export of portal products.

@EXPORT_OK
FormatPrice
GetImageUrl
IsProductValidPortal
IsProductValidPortalExt1
GetProductPrice
GetProductUrl
GetShippingPrice

Functions

FormatPrice
GetImageUrl
GetProductPrice
GetProductUrl
GetShippingPrice
IsProductValidPortal
IsProductValidPortalExt1

FormatPrice

formats prices (from shipping or products) to portal specific format.

Syntax
$FormattedValue = FormatPrice($Value, $PortalSite, $CurrencyID);
Input
$Value (float)
value to format
$PortalSite (object)
portal site
$CurrencyID (string)
currency id
Return
$FormattedValue (string)
formatted value

GetImageUrl

Returns url to product image.

Syntax
$URL = GetImageUrl($Product, $ImageAttribute);
Example
$URL = GetImageUrl($Product, $self->imageAttribute);
Input
$Product (object)
product
$ImageAttribute (object)
image attribute
$LanguageID (int)
language id
Return
$URL (string)
image url

GetProductPrice

get price of product with vars of portal config.

Syntax
$Price = GetProductPrice($Product, $CurrencyID, $TaxModel);
Input
$Product (object)
product
$CurrencyID (string)
currency id
$TaxModel (0/1)
tax model
Return
$Price (float)
product price

GetProductUrl

Returns url to product.

Syntax
$URL = GetProductUrl($Product);
Input
$PortalConfig (object)
portal config
$Product (object)
product
$Add2Basket (boolean)
use add to basket in url (optional)
$CurrencyID (string)
currency id (optional)
Return
$URL (string)
product url

GetShippingPrice

get shipping price for product with vars of portal config.

Syntax
$Value = GetShippingPrice($PortalConfig, $Product, $CurrencyID, $TaxModel);
Input
$PortalConfig (object)
portal config
$Product (object)
product
$CurrencyID (string)
currency id (optional)
$TaxModel (0/1)
tax model (optional)
Return
$Price (float)
shipping price

IsProductValidPortal

Throws error if not valid, (not visible).

Syntax
IsProductValidPortal($Product);
Input
$Product (object)
product

IsProductValidPortalExt1

Throws error if not valid (not visible, no name or no price).

Syntax
IsProductValidPortalExt1($PortalConfig, $Product);
Input
$PortalConfig (object)
portal config
$Product (object)
product
$CurrencyID (string)
currency id (optional)
$TaxModel (0/1)
tax model (optional)