public interface CommerceAddToCartStrategy
| Modifier and Type | Method and Description |
|---|---|
CommerceCartModification |
addToCart(CommerceCartParameter parameter)
Adds to the (existing)
CartModel the (existing) ProductModel in the given UnitModel and
with the given quantity. |
java.util.List<CommerceCartModification> |
addToCart(java.util.List<CommerceCartParameter> parameterList)
Adds a list of items to the cart.
|
CommerceCartModification addToCart(CommerceCartParameter parameter) throws CommerceCartModificationException
CartModel the (existing) ProductModel in the given UnitModel and
with the given quantity. If in the cart already an entry with the given product and given unit exists
the given quantity is added to the the quantity of this cart entry unless forceNewEntry
is set to true. After this the cart is calculated.parameter - - A parameter object containing all attributes needed for add to cart
CommerceCartParameter.cart - The user's cart in session
CommerceCartParameter.pointOfService - The store object for pick up in store items (only needs to be passed in if you are adding an item to pick up
CommerceCartParameter.product - The ProductModel to add
CommerceCartParameter.quantity - The quantity to add
CommerceCartParameter.unit - The UnitModel of the product @see ProductModel.getUnit()
CommerceCartParameter.createNewEntry - The flag for creating a new CartEntryModel
CommerceCartModificationException - if the product is a base product OR the quantity is less than 1 or no usable unit was
found (only when given unit is also null) or any other reason the cart could
not be modified.java.util.List<CommerceCartModification> addToCart(java.util.List<CommerceCartParameter> parameterList) throws CommerceCartMergingException
parameterList - a list of CommerceCartParameter itemsCommerceCartModification itemsCommerceCartMergingExceptionCopyright © 2018 SAP SE. All Rights Reserved.