Class Name |
|
---|---|
Component(s) |
|
The GetApplicablePromotions
servlet bean is used to determine which promotions can be applied to a given product or SKU.
The GetApplicablePromotions
servlet bean is instantiated from atg.commerce.pricing.GetApplicablePromotions
, which extends atg.commerce.pricing.
PriceItemDroplet.
Input Parameters
item (Required)
Either a RepositoryItem
that represents the item for which promotions are to be evaluated, or a CommerceItem
that can be evaluated directly. If the supplied item is a RepositoryItem
, then a new CommerceItem
is created.
pricingModels
collection of pricing models (promotions) used to price the items. If this value is not supplied, then by default a collection of pricing models from the user’s
ThePricingModelHolder
component is used. This component is resolved through the userPricingModelsPath
property.
locale
he locale in which the evaluation should take place.
T
profile
The user for whom pricing is performed. If this value is not supplied, then the profile is resolved through the property profilePath
.
product
The object that represents the product definition of the item to evaluate. Typically, items are SKUs. In that case, this is the product of the given SKU.
elementName
The name to use as the parameter set within the output
open parameter.
quantity
The Long quantity of the input product. This parameter is used when constructing a CommerceItem
from the supplied information.
Output Parameters
element
he evaluated
TCommerceItem
. This parameter name can be changed by setting the elementName
input parameter.
promotions
The promotions that apply to this CommerceItem
.
Open Parameters
output
The open parameter rendered if the CommerceItem
has been priced successfully.
Example
In the following example, the promotions, locale and profile are extracted from the request because they are not supplied as parameters.
<dsp:droplet name="/atg/commerce/pricing/GetApplicablePromotions"> <dsp:param name="product" param="product"/> <dsp:param name="item" param="product.childSkus[0]"/> <dsp:oparam name="output"> <dsp:droplet name="ForEach"> <dsp:param name="array" param="promotions"/> <dsp:oparam name="output"> Promotion: <dsp:valueof param="element.displayName"/><br> </dsp:oparam> </dsp:droplet> </dsp:droplet>