Вы находитесь на странице: 1из 5

ATG PRICING

PMDL (pricing model description language)


Qualifier when a promotion many apply
Target what may be discounted
Example
<pricing-model>
<qualifier>
<at-least number="2">
<collection-name>items</collection-name>
<element-name>item</element-name>
<element-quantity-property>quantity</element-quantity-property>
<contains>
<value>item.auxiliaryData.productRef.aliasId</value>
<constant>
<data-type>java.lang.String</data-type>
<string-value>spare-basic-crew</string-value>
</constant>
</contains>
</at-least>
</qualifier>
<target>
<every>
<collection-name>items</collection-name>
<element-name>item</element-name>
<contains>
<value>item.auxiliaryData.productRef.aliasId</value>
<constant>
<data-type>java.lang.String</data-type>
<string-value>spare-basic-crew</string-value>
</constant>
</contains>
</every>
</target>
</pricing-model>

Global Promotions
ATG finds the list of global promotions that it needs to apply at server startup
itself.
In all cases, Promotions need to be associated to Profiles. (registered or
anonymous) turn on logDebug on the below components to know more
details:
/atg/commerce/promotions/PromotionTools
/atg/commerce/promotions/ItemPricingEngine
/atg/commerce/promotions/OrderPricingEngine
Global promotions are not added to user profiles. Global promotions are
retrieved from the database at server startup. The set of global promotions is
kept in memory and is refreshed periodically. Every pricing operation
combines the global promotions with granted promotions in the user's
activePromotions property. promotions in the combined set are the
candidates to be applied to the order. Global promotions that have been
applied are not stored in the user's usedPromotions property.

Qualifier

A Helper class for discount calculators. Calculators call their helper method in this
class to determine to which items they should apply their discount. As a side effect,

the Qualifier also keeps track of which items acted as qualifiers for the input
promotion, if applicable, and marks their priceInfos as appropriate.
ItemDiscountCalculator uses findQualifyingItems
OrderDiscountCalculator uses findQualifyingOrder
ShippingDiscountCalculator uses findQualifyingShipping
TaxDiscountCalculator uses findQualifyingOrder
This class can be extended. New "findQualifyingX" methods can be added to act as
helper methods to new kinds of PricingCalculator. Any calculator that needs a rule to
determine whether to apply a discount might use the Qualifier class.
By default, the Qualifier evaluates rules written in PMDL (Pricing Model Description
Language). evaluateQualifier and evaluateTarget evaluate the qualfier and target
elements of PMDL repspectively. The evaluateQualfier and evaluateTarget methods
are protected and are available to be extended.
licenseFileNames is the component names of the license files which this
component requires.
pmdlCache is the cache which maps pricing model RepositoryItems to their
parsed PMDL bean representations.
pricingModelProperties is a list of the names of the properties of a pricing
model RepositoryItem.
There are a number of properties that can be configured to adjust the way in which
CommerceItems are allowed to participate in pricing rule evaluation. There are two
rules which make up a PMDL rule: the qualifier rule and target rule. Accordingly,
there two categories of filter property: filterForQualifier and filterForTarget.
In all of the properties listed below, a value of true indicates that items with the
specified attributes should be excluded from the qualification process.
Qualifier filters:
filterForQualifierNegativePrices: default = true. Toggle whether items with
negative prices should be allowed to act as qualifiers.
filterForQualifierZeroPrices: default = true. Toggle whether items with zero
prices should be allowed to act as qualifiers
filterForQualifierOnSale: default = false. Toggle whether items that were
priced with a sale price should be allowed to act as qualifiers

filterForQualifierDiscountedByCurrentDiscountId: default = true. Toggle


whether items discounted by the "current" discount should be allowed to act as
qualifiers
filterForQualifierDiscountedByAnyDiscountId: default = true. Toggle
whether items discounted by any discount should be allowed to act as
qualifiers. Masks filterForQualifierDiscountedByCurrentDiscountId (if this
property is on, it doesn't matter what the other property is set to)
Target filters:
filterForTargetNegativePrices: default = true. Toggle whether items with
negative prices should be allowed to receive the current discount
filterForTargetZeroPrices: default = true. Toggle whether items with zero
prices should be allowed to receive the current discount
filterForTargetPricesLessThanOrEqualToPromotionPrice: default = true.
Toggle whether items with prices that are already less than the price that would
be granted by a "fixed price" promotion should receive the promotion.
filterForTargetOnSale: default = false. Toggle whether items that were priced
with a sale price should be allowed to receive the current discount
filterForTargetDiscountedByCurrentDiscountId: default = true. Toggle
whether items that have been discounted by the current discount should be
allowed to receive the discount again
filterForTargetDiscountedByAnyDiscountId: default = true. toggle whether
items that have been discounted by any discount should be allowed to receive
the discount again
filterForTargetActedAsQualifierForAnyDiscount: default = true. toggle
whether items that have acted as a qualifier for any discount should be allowed
to receive the current discount

findQualifyingItems returns collection of QualifiedItem (Holds

information
about a CommerceItem that has qualified for a discount.).
QualifiedItem > DiscountStructure properties:

UID is a unique id for this discount structure.

calculatorType is the String type of calculator to use, e.g. bulk.


discountType is the String type of discount to apply, e.g. percentOff
adjuster (optional) is the Double adjustment amount to apply.
discountDetails (optional) is an List of DiscountDetail objects, e.g. providing
banded discount information
attributes (optional) is a Map of extra attributes that apply to this discount
type, e.g. bandingProperty to use
DiscountDetail

name, attributes

Вам также может понравиться