Class DefaultCommerceAddToCartStrategy
- java.lang.Object
-
- de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
-
- de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
-
- de.hybris.platform.commerceservices.order.impl.DefaultCommerceAddToCartStrategy
-
- All Implemented Interfaces:
CommerceAddToCartStrategy
- Direct Known Subclasses:
BundleCommerceAddToCartStrategy,CommerceAddToCartStrictStrategy,ProductConfigAddToCartStrategy,SelectiveCartAddToCartStrategy
public class DefaultCommerceAddToCartStrategy extends AbstractCommerceAddToCartStrategy
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
APPEND_AS_LAST
-
Fields inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY, forceInStockMaxQuantity
-
-
Constructor Summary
Constructors Constructor Description DefaultCommerceAddToCartStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CartEntryModeladdCartEntry(CommerceCartParameter parameter, long actualAllowedQuantityChange)CommerceCartModificationaddToCart(CommerceCartParameter parameter)Adds an item to the cart for pickup in a given locationjava.util.List<CommerceCartModification>addToCart(java.util.List<CommerceCartParameter> parameterList)Adds a list of items to the cart.protected CommerceCartModificationcreateAddToCartResp(CommerceCartParameter parameter, java.lang.String status, CartEntryModel entry, long quantityAdded)protected CartEntryModelcreateEmptyCartEntry(CommerceCartParameter parameter)protected CommerceCartModificationdoAddToCart(CommerceCartParameter parameter)Do add to cart.protected EntryMergeStrategygetEntryMergeStrategy()protected java.lang.StringgetStatusCodeAllowedQuantityChange(long actualAllowedQuantityChange, java.lang.Integer maxOrderQuantity, long quantityToAdd, long cartLevelAfterQuantityChange)protected java.lang.StringgetStatusCodeForNotAllowedQuantityChange(java.lang.Integer maxOrderQuantity, java.lang.Integer cartLevelAfterQuantityChange)protected UnitModelgetUnit(CommerceCartParameter parameter)protected java.lang.BooleanisProductForCode(CommerceCartParameter parameter)protected voidmergeEntry(CommerceCartModification modification, CommerceCartParameter parameter)voidsetEntryMergeStrategy(EntryMergeStrategy entryMergeStrategy)-
Methods inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceAddToCartStrategy
afterAddToCart, beforeAddToCart, getCommerceAddToCartMethodHooks, getConfigurationService, setCommerceAddToCartMethodHooks, setConfigurationService, validateAddToCart
-
Methods inherited from class de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
checkCartLevel, getAllowedCartAdjustmentForProduct, getAvailableStockLevel, getBaseStoreService, getCartEntryDao, getCartService, getCommerceCartCalculationStrategy, getCommerceStockService, getEntryForNumber, getEntryForProductAndPointOfService, getEntryOrderChecker, getForceInStockMaxQuantity, getModelService, getProductService, isMaxOrderQuantitySet, isOrderEntryUpdatable, isStockLevelSufficient, normalizeEntryNumbers, setBaseStoreService, setCartEntryDao, setCartService, setCommerceCartCalculationStrategy, setCommerceStockService, setEntryOrderChecker, setForceInStockMaxQuantity, setModelService, setProductService
-
-
-
-
Method Detail
-
addToCart
public java.util.List<CommerceCartModification> addToCart(java.util.List<CommerceCartParameter> parameterList) throws CommerceCartMergingException
Description copied from interface:CommerceAddToCartStrategyAdds a list of items to the cart.- Parameters:
parameterList- a list ofCommerceCartParameteritems- Returns:
- a list of
CommerceCartModificationitems - Throws:
CommerceCartMergingException
-
addToCart
public CommerceCartModification addToCart(CommerceCartParameter parameter) throws CommerceCartModificationException
Adds an item to the cart for pickup in a given location- Parameters:
parameter- Cart parameters- Returns:
- Cart modification information
- Throws:
CommerceCartModificationException
-
doAddToCart
protected CommerceCartModification doAddToCart(CommerceCartParameter parameter) throws CommerceCartModificationException
Do add to cart.- Parameters:
parameter- the parameter- Returns:
- the commerce cart modification
- Throws:
CommerceCartModificationException- the commerce cart modification exception
-
isProductForCode
protected java.lang.Boolean isProductForCode(CommerceCartParameter parameter)
-
createAddToCartResp
protected CommerceCartModification createAddToCartResp(CommerceCartParameter parameter, java.lang.String status, CartEntryModel entry, long quantityAdded)
-
getUnit
protected UnitModel getUnit(CommerceCartParameter parameter) throws CommerceCartModificationException
-
addCartEntry
protected CartEntryModel addCartEntry(CommerceCartParameter parameter, long actualAllowedQuantityChange) throws CommerceCartModificationException
-
mergeEntry
protected void mergeEntry(@Nonnull CommerceCartModification modification, @Nonnull CommerceCartParameter parameter) throws CommerceCartModificationException
-
getStatusCodeAllowedQuantityChange
protected java.lang.String getStatusCodeAllowedQuantityChange(long actualAllowedQuantityChange, java.lang.Integer maxOrderQuantity, long quantityToAdd, long cartLevelAfterQuantityChange)
-
getStatusCodeForNotAllowedQuantityChange
protected java.lang.String getStatusCodeForNotAllowedQuantityChange(java.lang.Integer maxOrderQuantity, java.lang.Integer cartLevelAfterQuantityChange)
-
createEmptyCartEntry
protected CartEntryModel createEmptyCartEntry(CommerceCartParameter parameter)
-
getEntryMergeStrategy
protected EntryMergeStrategy getEntryMergeStrategy()
-
setEntryMergeStrategy
public void setEntryMergeStrategy(EntryMergeStrategy entryMergeStrategy)
-
-