ePages 6.10 - 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
DISPLAYPRICE
DISPLAYPRICETAGINFOGROSS
ECOPARTICIPATION
HASPRICE
IsVariationAttribute
LISTPRICE
LOOPPosVariationTypeValues
MANUFACTURERPRICE
PREPAYMENT
REFERENCEPRICE

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

DISPLAYPRICE

Returns the display price of a product for a given currency, tax model and customer.

Syntax
#DISPLAYPRICE(#Product, #Currency, #TaxModel, #User)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #DISPLAYPRICE(#Object, #INPUT.Currency, #Shop.TaxModel, #User))
    #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)
#User (object)
user object

DISPLAYPRICETAGINFOGROSS

Returns true if gross price tag into needs to be displayed.

Syntax
#DISPLAYPRICETAGINFOGROSS(#Product, #TaxModel, #User)
#LOCAL("DisplayPriceTagInfoGross", #DISPLAYPRICETAGINFOGROSS(#Object, #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.

Syntax
#ECOPARTICIPATION(#Product, #Currency, #TaxModel, #ExraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("EcoParticipation", #ECOPARTICIPATION(#Object, #INPUT.Currency, #Shop.TaxModel, 1))
    #IF(#DEFINED(#EcoParticipation))
      #EcoParticipation[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

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, #Currency, #User)
Example
#IF(#HASPRICE(#Object, #INPUT.Currency, #Session.User.Object))
    <a href="...">add to basket</a>
#ENDIF
#IF(#HASPRICE(#Object, "EUR", #Session.User.Object))
    <a href="...">add to basket</a>
#ENDIF
Input
#Product (object)
product object
#Currency (string)
currency code, e.g. "EUR"
#User (object)
user object

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.

Syntax
#MANUFACTURERPRICE(#Product, #Currency, #TaxModel, #User, #ExtraPrecision)
Example
#LOCAL("CurrencyID", #INPUT.Currency)
  #LOCAL("ListPrice", #MANUFACTURERPRICE(#Object, #INPUT.Currency, #Shop.TaxModel, #User, 1))
    #IF(#DEFINED(#Price))
      #Price[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)
#User (object)
(optional) user object
#ExraPrecision (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

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