Class Name




The UnitPriceDetailDroplet can provide detailed price information for units in a given line item or groups, 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

The line item for which you want to display details. When you use this parameter, the appropriate servlet beans are requested. Note that the item parameter will not display any group information, even if you use the requestedBeans parameter.

The order for which price servlet beans are requested. When working with group discounts, commerce items can be split across multiple groups. As such, servlet beans are generated for an order, as opposed to a commerce item. If you pass in an order, you must pass in the requestedBeans.

Identifies which servlet bean to request. This parameter is used with the order parameter. If you pass in an item parameter, you do not need to specify a servlet bean to request. Variables include:

Note: If you use pass in all three input parameters, the item parameter will be ignored, and price information will be returned based upon the order and requestedBeans parameters.

Output Parameters

The droplet output is a list of UnitPriceBean objects ordered by commerce item and group.

Open Parameters

The open parameter is always rendered.


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"
      <c:forEach var="unitPriceBean" items="${unitPriceBeans}">

        <dsp:param name="unitPriceBean" value="${unitPriceBean}"/>
        <dsp:getvalueof var="quantity" vartype="java.lang.Double"
          <p class="price">
            <fmt:formatNumber value="${quantity}" type="number"/>
            <fmt:message key="common.atRateOf"/>
            <dsp:getvalueof var="unitPrice" vartype="java.lang.Double"
            <fmt:formatNumber value="${unitPrice}" type="currency"

        <dsp:getvalueof var="pricingModels" vartype="java.lang.Object"
            <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"/>
              </c:forEach><%-- End for each promotion used to create the unit
                   price --%>

              <dsp:getvalueof var="currentItemOnSale"
                <c:if test='${currentItemOnSale == "true"}'>
                  <p><fmt:message key="cart_detailedItemPrice.salePriceB"/></p>
  <%-- Render each price bean in the shopping cart. We supply an order a
            request for all beans sorted by group (allByGroup). Currently the only
            other supported option is 'groupedOnly' which will skip any bean that
            isn't part of a group --%>
       <dsp:droplet name="UnitPriceDetailDroplet">
         <dsp:param name="requestedBeans" value="allByGroup" />
         <dsp:param name="order" bean="ShoppingCart.current" />

Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices