Class Name |
|
|---|---|
Component(s) |
|
The PriceItem servlet bean is used to dynamically price a single item by taking promotions into account. Note that it does not apply order-dependent promotions, but only those that apply at the item level. If you need to show only a static price, you can retrieve the list or sale price directly from the SKU object.
The PriceItem servlet bean is instantiated from atg.commerce.pricing.PriceItemDroplet, which extends atg.commerce.pricing.ItemPricingDroplet.
For information on a servlet bean that can be used to price dynamically a collection of items, refer to PriceEachItemDroplet.
Input Parameters
item (Required)Either a RepositoryItem that represents the item to be priced, or a CommerceItem that can be priced directly. If the supplied item is a RepositoryItem, then a new CommerceItem is created for pricing.
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.
localehe locale in which the pricing should take place.
T
profileThe user for whom pricing is performed. If this value is not supplied, then the profile is resolved through the property profilePath.
productThe object that represents the product definition of the item to price. Typically, items that are priced are SKUs. In that case, this is the product of the given SKU.
elementNameThe name to use as the parameter set within the output open parameter.
quantity
The Long quantity of the input product that should be priced. This parameter is used when constructing a CommerceItem from the supplied information.
Output Parameters
elementhe priced
TCommerceItem. This parameter name can be changed by setting the elementName input parameter.
Open Parameters
outputThe 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/PriceItem"> <dsp:param param="sku" name="item"/> <dsp:param param="product" name="product"/> <dsp:param value="pricedItem" name="elementName"/> <dsp:oparam name="output"> <dsp:valueof param="pricedItem.priceInfo.amount" converter="currency"> no price</dsp:valueof> </dsp:oparam> </dsp:droplet>

