Wednesday, January 16, 2013

Difference Between Shopping Cart FormHandler & CartModifierFormHandler : ATG

CartModifierFormHandler - used to modify the shopping cart by adding items, deleting items and modifying the quantities of items in cart and preparing for checkout. Typically when using this you would have to handle checkout flow yourself by using ExpressCheckoutFormHandler in case of express checkout and in case of full checkout by using ShippingGroup & PaymentGroup form handlers and finally CommitFormHandler to confirm and commit the order.


ShoppingCartFormHandler - used for handling cart management (add/remove/adjust item quantity) and checkout process (shipping, billing, committing order). This provides an easier and simpler interface than using CartModifierFormHandler along other form handlers because in ShoppingCartFormHandler various functions for cart management to checkout are exposed via different handleXXX methods each having a preXXX and postXXX to extend the functionality if required. There is one FullShoppingCartFormHandler also which extends ShoppingCartFormHandler and adds the functionality like handling multiple payment groups, split shipping, express checkout.


To summarize, ShoppingCartFormHandler provides simpler cart management and checkout implementation all in itself. Whereas CartModifierFormHandler doesn't provide you the checkout flow and therefore CartModifierFormHandler based implementation would not be that simple and require other form handlers. But CartModifierFormHandler would provide some benefits like better handling and security for concurrent updates of orders, a more flexible payment/shipping group management for use with multiple shipping or payment groups along with other things.


Note:

ShoppingCartFormHandler is deprecated form handler from ATG2006.
It was common formhandler right from adding items to cart to submitting the order including shipping and billing.

From ATG2006, ATG introduced new formhandlers like CartModifierForHandler, ShippingGroupFormHandler, PaymentGroupFormHandler, CommitOrderFormHandler etc which has better control on transaction and module and handle complex checkout.

CartModifierFormhandler is restricted until Checkout, after checkout you need to use other form handler as mentioned.

ATG doesn't recommend using ShoppingCartFormHandler after ATG2006 and its there for back-ward compatibility

No comments:

Popular Posts