Develop > Controller layer > Application developer > Order Management subsystem > Filter shipping modes


Filter order item level shipping modes

Sometimes a shipping mode might not be applicable to all products. If you choose not to associate a shipping mode with a product, then no shipping charge will be applied to that product. Use the OrderItemShippingModeListDataBean to filter the applicable shipping modes of an order item or an array of order items, and provide estimated shipping charges and optional shipping adjustments for each shipping mode.

The filtering of applicable shipping modes is based on the estimated shipping charge. If using a specific shipping mode will result in a null shipping charge for an order item, that shipping mode will be ignored. The estimated shipping charge for the shipping mode of each order item assumes that the shipping charge can be determined by itself and is not affected by other order items within the same order. For example, if there is an order level shipping charge configuration, such as $10.00 for an order, the shipping charge for each order item in ShippingMethod will be $10.00 and the shipping charge for the entire order in the OrderSummary page will be $10.00. The data bean considers each order item to be a standalone order and estimates the shipping charges for the order items.

The following instructions describe how to customize the storefront shopping flow. They do not describe how to customize order creation in the WebSphere Commerce Accelerator.


Procedure

  1. Refer to the OrderShippingModeListDataBean data bean. The following table shows the input parameters for this data bean.

    Name Description
    orderItemId Optional: Use this parameter to set one order item to the data bean.
    orderItemIds Optional: Use this parameter to set a list of order items to the data bean.
    allowableShippingModeIds Optional: If this parameter is set to true, the data bean will filter a list of the applicable shipping modes. If this parameter is set to false, the data bean will return the intersection of the shipping modes that are allowed for each order item. If the allowableShippingModeIds parameter is not set, the OrderItemShippingModeListDataBean retrieves the shipping modes that are supported by the contracts.
    calculateShippingCharge If this parameter is set to true, the data bean will filter the shipping modes that are not applicable and estimate the charge for each shipping mode. If this parameter is set to false, the data bean will return the intersection of the shipping modes that are allowed for each order item.
    CalculateShippingAdjustment This parameter will only take effect if the calculateShippingCharge parameter is set to true. If this parameter is set to true, the data bean will add the shipping adjustment of the shipping promotion result while calculating the shipping charge.
    resolveFulfillmentCenter This parameter will only take effect if the calculateShippingCharge parameter is set to true. Since some shipping charge configuration is related to the fulfillment center, if this parameter is set to true the data bean will resolve the fulfillment centers of the items in the given order before calculating the shipping charge. Typically, this flag should be set to true since shipping configuration almost always relates to the fulfillment center.
    checkAppliedItems Optional: By default, this parameter is set to true. In previous releases, STENCALUSG.USAGEFLAGS must be set to 3 to filter shipping modes.

  2. Change the store flow to support a single shipping address and a single shipping method:

    1. Open the WebSphere Commerce Accelerator.

    2. Select Store > Change Flow.

    3. Select Checkout.

    4. Select Multiple shipping methods and click Apply.

  3. Customize the JSP file to use the OrderItemShippingModeListDataBean to select the shipping mode.

    <c:remove var="orderItemShippingModeList"/>     
    <wcbase:useBean id="orderItemShippingModeList" classname="com.ibm.commerce.fulfillment.beans.OrderItemShippingModeListDataBean">      
    <c:set target="${orderItemShippingModeList}" property="orderItemId" value="${orderItem}"/>          
    <c:set target="${orderItemShippingModeList}" property="resolveFulfillmentCenter" value="true"/>         
    <c:set target="${orderItemShippingModeList}" property="calculateShippingCharge" value="true"/>           
    <c:set target="${orderItemShippingModeList}" property="calculateShippingAdjustment" value="true"/>      
    
    </wcbase:useBean>      
         </pre>      
    <table>          
    <tr>                
    <th><pre>Shipping Mode ID:</pre></th>             
    <th><pre>Shipping Mode Description:</pre></th>             
    <th><pre>Shipping Charge:</th>          
    </tr>         
             <c:forEach items="${orderItemShippingModeList.shippingModes}" var="shippingMode" varStatus="status">          
    <tr>          
    <td><c:out value="${shippingMode.shippingModeId}"/></td>          
    <td><c:out value="${shippingMode.description.description}"/></td>          
    <td><c:out value="${orderItemShippingModeList.shippingCharges[status.index]}"/></td>          
    </tr> 
         </c:forEach>         
         </table>
    


Related concepts

Ship

Ship codes


Related tasks

Filter shipping modes

Customize shipping charges


+

Search Tips   |   Advanced Search