ATG CartModifierFromHandler And ShoppingCartfromHandler DIfference

CartModifierFormHandler: 
Used to modify the shopping cart by adding item, deleting items and modifying the item quantities of item in cart and preparing for checkout process. Typically when using this you would have to handle checkout flow yourself by ExpressChecoutFormHandler in case of express checkout and in case of full checkout by using ShippingGroup and PaymentGroup from handlers and finally CommitFormHanlder 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 Full ShoppingCartFormHandler 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.

No comments: