1. How do you add an item to cart?
Using addItemToOrder method of CartModifierFormHandler by passing catalogRefId, quantity and productId in the product details page.
2. How do you display items in the cart page?
We will get the current order from the ShoppingCart component. We will pass the ShoppingCart.current.commerceItems to the ForEach droplet.
3. How do you update the quantity of a commerce item in the cart page?
First we will set CheckForChangedQuantity of the CartModifierFormHandler to true in the JSP page. And for the quantity field we will give the name as catalogRefId. Finally, we will call handleSetOrder method of CartModifierFormHandler to update the quantity.
4. How do u remove items from cart ?
We will set the removalCommerceIds property of CartModifierFormHandler to the items and call handleSetOrder method of CartModifierFormHandler. This is used to remove one or more items at the same time.
To remove single item handleRemoveItemFromOrder method of CartModifierFormHandler.
5. How do u save the order or cart?
We can use SaveOrderFormHandler to save the order.When we call handleSaveOrder method of SaveOrderFormHandler , the current order will be saved to the ShoppingCart.saved property and it will create a new order will be set to ShoppingCart.current.
6. How do u retrieve the saved order back to the current order?
We can use ShoppingCart.switch method by passing handleOrderId which will look up the order from the order repository and set to the current order of ShoppingCart.
7. How do u proceed to checkout page?
We will call to moveToPurchaseInfo method of the CartModifierFormHandler which will execute the moveToPurchaseInfo pipeline chain and check the order and commerce items and validates them. Then, checkout login page will be displayed if the user has not logged yet. Otherwise user will be directed to the shipping page.
8. How do you set the shipping address to the order or shipping group?
We use the ShippingGroup droplet to display all the available shipping addresses. The ShiipingGroupDroplet will get the available addresses from the Profile’s shipingAddress and secondaryAddresses properties.
Then the user will select the shippingAddress from the list. Then the selected address will be set the current shipping group by calling the handleApplyShippingGroups method of ShippingGroupFormHandler.
We can create a shipping group manually by using the ShippingGroupManager.createShippingGroup by passing the address. After that we call ShippingGroupManager.addShippingGroupToOrder method.
The user will also select the shipping method and set to the shipping group such as NextDay , Two Day or Ground.
We will use AvailableShippingMethods droplet which fetches all the shipping methos names from the Shipping calculators. Each Shipping Calculator has a property called shiipingMethod.
9. What are the different relationship objects in the order?
ShiipingGroupCommerceItemRelationShip, PaymentGroupCommerceItemRelationShip
, PaymentGroupShipingGroupRelationShip, PaymentGroupOrderRelationShip
10. How do you split items to multiple shipping addresses?
We call the handleSpliShippingInfos method of ShippingGroupFormHandler to split the item quantity to different shipping group. Then we call handleApplyShippingGroups method ShippingGroupFormHandler. On successful the payment page will be displayed.
Using addItemToOrder method of CartModifierFormHandler by passing catalogRefId, quantity and productId in the product details page.
2. How do you display items in the cart page?
We will get the current order from the ShoppingCart component. We will pass the ShoppingCart.current.commerceItems to the ForEach droplet.
3. How do you update the quantity of a commerce item in the cart page?
First we will set CheckForChangedQuantity of the CartModifierFormHandler to true in the JSP page. And for the quantity field we will give the name as catalogRefId. Finally, we will call handleSetOrder method of CartModifierFormHandler to update the quantity.
4. How do u remove items from cart ?
We will set the removalCommerceIds property of CartModifierFormHandler to the items and call handleSetOrder method of CartModifierFormHandler. This is used to remove one or more items at the same time.
To remove single item handleRemoveItemFromOrder method of CartModifierFormHandler.
5. How do u save the order or cart?
We can use SaveOrderFormHandler to save the order.When we call handleSaveOrder method of SaveOrderFormHandler , the current order will be saved to the ShoppingCart.saved property and it will create a new order will be set to ShoppingCart.current.
6. How do u retrieve the saved order back to the current order?
We can use ShoppingCart.switch method by passing handleOrderId which will look up the order from the order repository and set to the current order of ShoppingCart.
7. How do u proceed to checkout page?
We will call to moveToPurchaseInfo method of the CartModifierFormHandler which will execute the moveToPurchaseInfo pipeline chain and check the order and commerce items and validates them. Then, checkout login page will be displayed if the user has not logged yet. Otherwise user will be directed to the shipping page.
8. How do you set the shipping address to the order or shipping group?
We use the ShippingGroup droplet to display all the available shipping addresses. The ShiipingGroupDroplet will get the available addresses from the Profile’s shipingAddress and secondaryAddresses properties.
Then the user will select the shippingAddress from the list. Then the selected address will be set the current shipping group by calling the handleApplyShippingGroups method of ShippingGroupFormHandler.
We can create a shipping group manually by using the ShippingGroupManager.createShippingGroup by passing the address. After that we call ShippingGroupManager.addShippingGroupToOrder method.
The user will also select the shipping method and set to the shipping group such as NextDay , Two Day or Ground.
We will use AvailableShippingMethods droplet which fetches all the shipping methos names from the Shipping calculators. Each Shipping Calculator has a property called shiipingMethod.
9. What are the different relationship objects in the order?
ShiipingGroupCommerceItemRelationShip, PaymentGroupCommerceItemRelationShip
, PaymentGroupShipingGroupRelationShip, PaymentGroupOrderRelationShip
10. How do you split items to multiple shipping addresses?
We call the handleSpliShippingInfos method of ShippingGroupFormHandler to split the item quantity to different shipping group. Then we call handleApplyShippingGroups method ShippingGroupFormHandler. On successful the payment page will be displayed.
No comments:
Post a Comment
Thanks for your comment. Please be genuine, do not spam, Comments posted with links will be considered as spam.