ePages 7.1.0 - DE_EPAGES/Product/API/TLE/ProductHandler.pm

Package DE_EPAGES::Product::API::TLE::ProductHandler

Implements TLE functions for products.

Functions

APPOINTMENTMENT_PREPAYMENT
APPOINTMENTMENT_PRICE
AppointmentDayList
BUNDLEDLISTPRICESUM
CANDISPLAYFROMPRICE
DEPOSIT
DISPLAYFREETAXINFO
DISPLAYPRICE
DISPLAYPRICETAGINFOGROSS
ECOPARTICIPATION
HASPRICE
HasUserDefinedAttributes
InvisibleVariations
IsVariationAttribute
LISTPRICE
LOOPPosVariationTypeValues
MANUFACTURERPRICE
PREPAYMENT
PRICESAVINGS
ProductURL
REFERENCEPRICE
UnavailableVariations

APPOINTMENTMENT_PREPAYMENT

Returns the value for prepayment.

Syntax
#APPOINTMENTMENT_PREPAYMENT(#Product, #CurrencyID, #TaxModel, #User, #Quantity)
Input
#Product (object)
product object
#CurrencyID (string)
currency code, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object
#Quantity (integer)
quantity

APPOINTMENTMENT_PRICE

Returns true if price tag into needs to be displayed.

Syntax
#APPOINTMENTMENT_PRICE(#Product, #CurrencyID, #TaxModel, #User, #Quantity)
Input
#Product (object)
product object
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object

AppointmentDayList

Returns the DE_EPAGES::Calendar::API::Object::Calendar::dayList for the given product DE_EPAGES::Product::API::Object::Product::businessHours.

Syntax
#AppointmentDayList(#Product, #Date)
Example
#LOOP(#AppointmentDayList(#Object, #NOW))
#ENDLOOP
Input
#Product (object)
product object
#Date (DateTime)
date

BUNDLEDLISTPRICESUM

Returns the sum of the list prices of all items of a bundle product. See also: LISTPRICE

Syntax
#BUNDLEDLISTPRICESUM(#Product, #Currency, #TaxModel)
Example
#LOCAL("SumPrice", #BUNDLEDLISTPRICESUM(#Object, #INPUT.Currency, #Shop.TaxModel))
  #SumPrice[money]
#ENDLOCAL
Input
#Product (object)
product object (must be a bundle product)
#Currency (string)
currency code, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object

CANDISPLAYFROMPRICE

Returns true if "from prices" can be displayed. - VariationPriceFromText must be set - product must be the default sub product or product must be the master product and a available, cheaper sub product with an own price must exists

Syntax
#CANDISPLAYFROMPRICE(#Product)
Input
#Product (object)
product object

DEPOSIT

Returns the deposit price of a product for a given currency and tax model. If user is defined the tax model of the user take effect.

Syntax
#DEPOSIT(#Product, #CurrencyID, #TaxModel, #User, #ExtraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("Deposit", #DEPOSIT(#Product, #CurrencyID, #Shop.TaxModel, #User, 1))
    #IF(#DEFINED(#Deposit))
      #Deposit[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#CurrencyID (string)
currency ID, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object
#ExtraPrecision (int)
(optional, default=0) extra precision

DISPLAYFREETAXINFO

Returns true if the 'free tax' text should be displayed.

Syntax
#DISPLAYFREETAXINFO($Product, $User)
#LOCAL("DisplayFreeTaxInfo", #DISPLAYFREETAXINFO($Product, $User))
    #IF(#DisplayFreeTaxInfo) #Shop.PriceTagInfoSingleProductFreeTax #ENDIF
#ENDLOCAL
Input
#Product (object)
product object
#User (object)
(optional) user object

DISPLAYPRICE

Returns the display price of a product for a given currency, tax model and customer. If user is defined the tax model of the user take effect.

Syntax
#DISPLAYPRICE(#Product, #CurrencyID, #TaxModel, #User, #NoFromPrice)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #DISPLAYPRICE(#Product, #CurrencyID, #Shop.TaxModel, #User, #NoFromPrice))
    #IF(#DEFINED(#ListPrice))
      #ListPrice[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#CurrencyID (string)
currency ID, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object
#NoFromPrice (boolean)
do not use the from price calculation

DISPLAYPRICETAGINFOGROSS

Returns true if gross price tag into needs to be displayed. If user is defined the tax model of the user take effect.

Syntax
#DISPLAYPRICETAGINFOGROSS(#Product, #TaxModel, #User)
#LOCAL("DisplayPriceTagInfoGross", #DISPLAYPRICETAGINFOGROSS(#Product, #Shop.TaxModel, #User))
    #IF(#DisplayPriceTagInfoGross) #Shop.PriceTagInfoMultiProductGross #ENDIF
#ENDLOCAL
Input
#Product (object)
product object
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object

ECOPARTICIPATION

Returns the list price of a product for a given currency and tax model. If user is defined the tax model of the user take effect.

Syntax
#ECOPARTICIPATION(#Product, #CurrencyID, #TaxModel, #User, #ExtraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("EcoParticipation", #ECOPARTICIPATION(#Product, #CurrencyID, #Shop.TaxModel, #User, 1))
    #IF(#DEFINED(#EcoParticipation))
      #EcoParticipation[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#CurrencyID (string)
currency ID, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object
#ExtraPrecision (int)
(optional, default=0) extra precision

HASPRICE

Returns true if a price exists for the given product, currency and user, i.e. either a customer specific price for 1 item or the list price.

Syntax
#HASPRICE(#Product, #CurrencyID, #User)
Example
#IF(#HASPRICE(#Product, #INPUT.Currency, #Session.User.Object))
    <a href="...">add to basket</a>
#ENDIF
#IF(#HASPRICE(#Product, "EUR", #Session.User.Object))
    <a href="...">add to basket</a>
#ENDIF
Input
#Product (object)
product object
#CurrencyID (string)
currency ID, e.g. "EUR"
#User (object)
user object

HasUserDefinedAttributes

Returns if a product has user-defined attributes that are displayed on the "Description" tab on the product page.

Syntax
#HasUserDefinedAttributes(#Product)
Example
#IF(#HasUserDefinedAttributes(#Object))
  #LOOP(#UserDefinedAttributeValues) .. #ENDLOOP
#ENDIF
Input
#Product (object)
product object
Return
#Result (boolean)
true if the product has userdefined attributes

InvisibleVariations

Finds all AttributeValueIDs which are invisible in context to already selected attribute values and possible unselected ones.

Syntax
#InvisibleVariations(#Product, #SelectParams)
Example
#LOCAL("InvisibleVariationIDs", #InvisibleVariations(#Object, #SelectParams))
  #IF(#KEY(#InvisibleVariationIDs, #ID)) ... #ENDIF
#ENDLOCAL
Input
#Product (object)
super or sub product object
#SelectParams (ref.array.hash)
array of hashes including already selected attribute
object id's and predefattribute id's
Return
#Result (ref.hash)
hash (id => 1) of invisible attribute value id's

IsVariationAttribute

Tests if the attribute is a variation attribute of product.

Syntax
#IsVariationAttribute(#Product, #Attribute)
#LOOP(#UserDefinedAttributeValues)
  #IF(#IsVariationAttribute(#Object, #Attribute))
    #Attribute.NameOrAlias = #Value
  #ENDIF
#ENDIF
Input
#Product (object)
product object
#Attribute (object)
attribute object

LISTPRICE

Returns the list price of a product for a given currency and tax model.

Syntax
#LISTPRICE(#Product, #Currency, #TaxModel, #ExraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #LISTPRICE(#Object, #INPUT.Currency, #Shop.TaxModel, 1))
    #IF(#DEFINED(#ListPrice))
      #ListPrice[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#Currency (string)
currency code, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#ExraPrecision (int)
(optional, default=0) extra precision

LOOPPosVariationTypeValues

Loops the template code for each variation type. The TLE variables #Attribute and #PreDefAttributes can be used within the block. #Attibute contains the attribute object. #PreDefAttributes contains a list of all available values of the variation type. #IsUsed indicates if the value is used by the product.

Syntax
#BLOCK("LOOPPosVariationTypeValues", #Product) template #ENDBLOCK
Example
#BLOCK("LOOPPosVariationTypeValues", #Object)
  #Attribute.NameOrAlias
  #LOOP(#PreDefAttributes)
    #ValueOrAlias #IF(NOT #IsUsed)(not used)#ENDIF
  #ENDLOOP
#ENDBLOCK
Input
#Product (object)
product object

MANUFACTURERPRICE

Returns the manufacturer's suggested retail price of a product for a given currency and tax model. If user is defined the tax model of the user take effect.

Syntax
#MANUFACTURERPRICE(#Product, #CurrencyID, #TaxModel, #User, #ExtraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #MANUFACTURERPRICE(#Product, #CurrencyID, #Shop.TaxModel, #User, 1))
    #IF(#DEFINED(#ListPrice))
      #Price[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#CurrencyID (string)
currency ID, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#User (object)
(optional) user object
#ExtraPrecision (int)
(optional, default=0) extra precision

PREPAYMENT

Returns the prepayment of an appointment for a given currency and tax model.

Syntax
#PREPAYMENT(#Product, #Currency, #TaxModel, #ExraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("Prepayment", #PREPAYMENT(#Object, #INPUT.Currency, #Shop.TaxModel, 1))
    #IF(#DEFINED(#Prepayment))
      #Prepayment[money]
    #ENDIF
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#Currency (string)
currency code, e.g. "EUR"
#TaxModel (int)
tax calculation model (0=net, 1=gross)
#ExraPrecision (int)
(optional, default=0) extra precision

PRICESAVINGS

Returns the percentage or absolute value of the pricesavings.

Syntax
#PRICESAVINGS(#Product, #Price1, #Price2)
Example
#LOCAL("PriceSavings", #PRICESAVINGS(#Object, #DisplayPrice, #ManufacturerPrice))
  #IF(#DEFINED(#PriceSavings))<div>#PriceSavings</div>#ENDIF
#ENDLOCAL
Input
#Product (object)
product object
#Price1 (string)
lower price e.g. DisplayPrice
#Price2 (int)
comparison price e.g. ManufacturerPrice

ProductURL

Returns the URL to the product detail page. If this function is called from a search results, additional paramters are passed to the detail page in order to select the appropriate image and variation values in case of a variation product.

Syntax
#ProductURL(#Product)
Input
#Product (object)
product object

REFERENCEPRICE

Calculates the price of a product relative to the reference amout. The following formula is used:
#Price * (#Product.RefAmount / #Product.RefContentAmount)

Syntax
#REFERENCEPRICE(#Product, #Price, #CurrencyID)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #LISTPRICE(#Object, #INPUT.Currency, #Shop.TaxModel))
    #LOCAL("ReferencePrice",#REFERENCEPRICE(#Object, #ListPrice, #CurrencyID))
      #IF(#ReferencePrice != #ListPrice)
        #RefAmount#RefUnit.Abbreviation = #ReferencePrice[money]
      #ENDIF
    #LOCAL
  #ENDLOCAL
#ENDLOCAL
Input
#Product (object)
product object
#Price (float)
price

UnavailableVariations

Finds all AttributeValueIDs which are unavailable in context to already selected attribute values and possible unselected ones.

Syntax
#UnavailableVariations(#Product, #SelectParams)
Example
#LOCAL("UnavailableVariationIDs", #UnavailableVariations(#Object, #SelectParams))
  #IF(#KEY(#UnavailableVariationIDs, #ID)) ... #ENDIF
#ENDLOCAL
Input
#Product (object)
super or sub product object
#SelectParams (ref.array.hash)
array of hashes including already selected attribute
object id's and predefattribute id's
Return
#Result (ref.hash)
hash (id => 1) of unavailable attribute value id's