Interface CartFacade
- All Known Subinterfaces:
B2BCartFacade
- All Known Implementing Classes:
DefaultB2BCartFacade,DefaultCartFacade
public interface CartFacade
Defines an API for cart manipulation, responsible for managing entries for cart.
-
Method Summary
Modifier and TypeMethodDescriptionaddOrderEntry(OrderEntryData cartEntry) Method for adding a product to cart.addOrderEntryList(List<OrderEntryData> cartEntries) Method for adding a product to cart.This gets the current cart.voidIf existing the current session cart is being detached from this session and removed.Updates the information in the cart based on the content of the cartDataupdateOrderEntry(OrderEntryData cartEntry) Method for updating the number of products.updateOrderEntryList(List<OrderEntryData> cartEntries) Method for updating a list of products in the cart.Method for validating every entry in the cart
-
Method Details
-
addOrderEntry
Method for adding a product to cart.- Parameters:
cartEntry- the cart entry with the new product to add..- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
- Throws:
EntityValidationException- if the validation fails.
-
updateOrderEntry
Method for updating the number of products.- Parameters:
cartEntry- the cart entry with the new value of quantity for product.- Returns:
- the cart modification data that includes a statusCode and the actual quantity that the entry was updated to
- Throws:
EntityValidationException- if the validation fails.
-
addOrderEntryList
Method for adding a product to cart.- Parameters:
cartEntries- the cart entries with the new products to add.- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
-
updateOrderEntryList
Method for updating a list of products in the cart.- Parameters:
cartEntries- the cart entries with the new products to add.- Returns:
- the cart modification data that includes a statusCode and the actual quantity added to the cart
-
update
Updates the information in the cart based on the content of the cartData- Parameters:
cartData- the cart to modify and it's modifications.- Returns:
- the updated cart.
-
getCurrentCart
CartData getCurrentCart()This gets the current cart.- Returns:
- the current cart.
-
validateCurrentCartData
Method for validating every entry in the cart- Returns:
- a list of cart modifications that includes a statusCode and the actual quantity that the entry was updated to
- Throws:
CommerceCartModificationException- if the cart cannot be modified
-
removeSessionCart
void removeSessionCart()If existing the current session cart is being detached from this session and removed. Afterwards it's no longer available.
-