In a checkout process, a user can make changes, such as to the cart or the shipping information, that can affect the pricing of the order. ATG Commerce provides several methods for repricing an order. For example, the CartModifierFormHandler class automatically reprices an order after any change to the shopping cart. However, other purchase process form handlers do not automatically reprice the order, so it must be repriced explicitly.

In the Motorprise checkout process, users submit shipping information before billing information. They can change information, such as address or shipping method, that may affect the shipping price, and therefore the total order price. The ShippingGroupFormHandler used on the shipping pages does not automatically reprice the order. Thus, the order must be repriced explicitly on the billing pages to ensure that the price reflects the new shipping information.

We used the RepriceOrderDroplet at the top of the billing pages billing_invoice.jsp, billing_invoice_cc.jsp, and billing_cc.jsp, to reprice the order as follows:

<dsp:importbean bean="/atg/commerce/order/purchase/RepriceOrderDroplet"/>

<%--Reprice the Order total so that we can assign PaymentGroups to any
CommerceIdentifier.
--%>
<dsp:droplet name="RepriceOrderDroplet">
  <dsp:param name="pricingOp" value="ORDER_TOTAL"/>
</dsp:droplet>
 
loading table of contents...