Class Name |
|
|---|---|
Component(s) |
|
The UnitPriceDetailDroplet can provide detailed price information for units in a given line item, along with discount information. This is useful for displaying information such as “3 @ $2.00” or “2 @ $10.00, 1 @ $0.00 (Buy 2 Get 1 Free)”.
Input Parameters
item (Required)
The line item for which you want to display details.
Output Parameters
UnitPriceBeans
The droplet output is a list of UnitPriceBean objects.
Open Parameters
output
The open parameter is always rendered.
Example
The following example shows a portion of a JSP that uses the UnitPriceDetailDroplet servlet bean to display detailed information about line items in an order.
<dsp:droplet name="UnitPriceDetailDroplet">
<dsp:param name="item" param="currentItem"/>
<dsp:oparam name="output">
<dsp:getvalueof var="unitPriceBeans" vartype="java.lang.Object"
param="unitPriceBeans"/>
<c:forEach var="unitPriceBean" items="${unitPriceBeans}">
<dsp:param name="unitPriceBean" value="${unitPriceBean}"/>
<dsp:getvalueof var="quantity" vartype="java.lang.Double"
param="unitPriceBean.quantity"/>
<p class="price">
<fmt:formatNumber value="${quantity}" type="number"/>
<fmt:message key="common.atRateOf"/>
<dsp:getvalueof var="unitPrice" vartype="java.lang.Double"
param="unitPriceBean.unitPrice"/>
<fmt:formatNumber value="${unitPrice}" type="currency"
currencyCode="${currencyCode}"/>
</p>
<dsp:getvalueof var="pricingModels" vartype="java.lang.Object"
param="unitPriceBean.pricingModels"/>
<c:choose>
<c:when test="${not empty pricingModels}">
<c:forEach var="pricingModel" items="${pricingModels}">
<dsp:param name="pricingModel" value="${pricingModel}"/>
<p class="note">
(<dsp:valueof param="pricingModel.description">
<fmt:message key="common.promotionDescriptionDefault"/>
</dsp:valueof>)
</p>
</c:forEach><%-- End for each promotion used to create the unit
price --%>
</c:when>
<c:otherwise>
<dsp:getvalueof var="currentItemOnSale"
param="currentItem.priceInfo.onSale"/>
<c:if test='${currentItemOnSale == "true"}'>
<p><fmt:message key="cart_detailedItemPrice.salePriceB"/></p>
</c:if>
</c:otherwise>
</c:choose>
</c:forEach>
</dsp:oparam>
</dsp:droplet>
