Develop > Controller layer > Application developer > Order Management subsystem
Filter 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. You can filter applicable shipping modes by customizing according to the instructions below.
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
- Refer to the OrderShippingModeListDataBean data bean. This data bean lists the shipping modes available to a given order. The following table shows the input parameters.
Name Description order The OrderDataBean calculateShippingCharge If this parameter is set to true, this data bean will filter the shipping modes that are not applicable and estimate the shipping charge of each shipping mode. If this parameter is set to false, this data bean will return the intersection of the shipping modes that are allowed for each order item. CalculateShippingAdjustment This parameter will take effect only if the calculateShippingCharge parameter is set to true. If this parameter is set to true, this data bean will add the shipping adjustment of the shipping promotion result while calculating the shipping charge. resolveFulfillmentCenter This parameter will take effect only 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 this 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.
- For any shipping mode returned by the OrderShippingModeListDataBean, a shipping charge can be calculated.
- Change the store flow to allow a single shipping address and a single shipping method.
- Open WebSphere Commerce Accelerator.
- Select Store > Change Flow.
- Select Checkout.
- Select Single shipping methods.
- Click Apply. This update can take some time.
The OrderShippingModeListDataBean can only support shipping with one address and one shipping method for an order.
- Apply the OrderShippingModeListDataBean in the JSP file. For example, change the AdvancedOrderForm.jsp file. Customize the JSP file for selecting shipping mode as shown in the following code snippet:
<wcbase:useBean id="orderShippingModeList" classname="com.ibm.commerce.fulfillment.beans.OrderShippingModeListDataBean"> <c:set target="${orderShippingModeList}" property="order" value="${orderBean}"/> <c:set target="${orderShippingModeList}" property="calculateShippingCharge" value="true"/> <c:set target="${orderShippingModeList}" property="resolveFulfillmentCenter" value="true"/> <c:set target="${orderShippingModeList}" property="calculateShippingAdjustment" value="true"/> </wcbase:useBean> //the orderShippingModeList contains all the filtered shipping modes <table> <tr> <th>ShipMode ID</th> <th>Shipping Mode</th> <th>Shipping Charge</th> </tr> <c:forEach items="${orderShippingModeList.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="${orderShippingModeList.shippingCharges[status.index]}"/></td> </tr> </c:forEach> </table>
Related concepts
Related tasks
Filter order item level shipping modes