Class AbstractCommerceCartStrategy
- java.lang.Object
-
- de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
-
- Direct Known Subclasses:
AbstractCommerceAddToCartStrategy
,AbstractCommerceCloneSavedCartStrategy
,AbstractCommerceFlagForDeletionStrategy
,AbstractCommerceSaveCartStrategy
,DefaultCommerceCartMergingStrategy
,DefaultCommerceCartRestorationStrategy
,DefaultCommerceCartSplitStrategy
,DefaultCommerceUpdateCartEntryStrategy
,DefaultSubscriptionCommerceCartStrategy
public abstract class AbstractCommerceCartStrategy extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static long
DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY
protected long
forceInStockMaxQuantity
-
Constructor Summary
Constructors Constructor Description AbstractCommerceCartStrategy()
-
Method Summary
-
-
-
Field Detail
-
DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY
protected static final long DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY
- See Also:
- Constant Field Values
-
forceInStockMaxQuantity
protected long forceInStockMaxQuantity
-
-
Method Detail
-
getAllowedCartAdjustmentForProduct
protected long getAllowedCartAdjustmentForProduct(CartModel cartModel, ProductModel productModel, long quantityToAdd, PointOfServiceModel pointOfServiceModel)
Work out the allowed quantity adjustment for a product in the cart given a requested quantity change.- Parameters:
cartModel
- the cartproductModel
- the product in the cartquantityToAdd
- the amount to increase the quantity of the product in the cart, may be negative if the request is to reduce the quantitypointOfServiceModel
- the PointOfService to check stock at, can be null- Returns:
- the allowed adjustment
-
isStockLevelSufficient
protected boolean isStockLevelSufficient(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel, long quantityToAdd)
Work out if the stock level is sufficient for a product in the cart given a requested quantity change.- Parameters:
cartModel
- the cartproductModel
- the product in the cartpointOfServiceModel
- the PointOfService to check stock at, can be nullquantityToAdd
- the amount to increase the quantity of the product in the cart, may be negative if the request is to reduce the quantity- Returns:
- the allowed adjustment
-
getAvailableStockLevel
protected long getAvailableStockLevel(ProductModel productModel, PointOfServiceModel pointOfServiceModel)
-
checkCartLevel
protected long checkCartLevel(ProductModel productModel, CartModel cartModel, PointOfServiceModel pointOfServiceModel)
-
isMaxOrderQuantitySet
protected boolean isMaxOrderQuantitySet(java.lang.Integer maxOrderQuantity)
-
normalizeEntryNumbers
protected void normalizeEntryNumbers(CartModel cartModel)
-
isOrderEntryUpdatable
protected boolean isOrderEntryUpdatable(AbstractOrderEntryModel entryToUpdate)
-
getEntryForNumber
protected AbstractOrderEntryModel getEntryForNumber(AbstractOrderModel order, int number)
-
getEntryForProductAndPointOfService
protected java.lang.Integer getEntryForProductAndPointOfService(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel)
-
getProductService
protected ProductService getProductService()
-
setProductService
public void setProductService(ProductService productService)
-
getCartService
protected CartService getCartService()
-
setCartService
public void setCartService(CartService cartService)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
getCommerceStockService
protected CommerceStockService getCommerceStockService()
-
setCommerceStockService
public void setCommerceStockService(CommerceStockService commerceStockService)
-
getBaseStoreService
protected BaseStoreService getBaseStoreService()
-
setBaseStoreService
public void setBaseStoreService(BaseStoreService baseStoreService)
-
getForceInStockMaxQuantity
protected long getForceInStockMaxQuantity()
-
setForceInStockMaxQuantity
public void setForceInStockMaxQuantity(long forceInStockMaxQuantity)
-
getEntryOrderChecker
protected ModifiableChecker<AbstractOrderEntryModel> getEntryOrderChecker()
-
setEntryOrderChecker
public void setEntryOrderChecker(ModifiableChecker<AbstractOrderEntryModel> entryOrderChecker)
-
getCartEntryDao
protected CartEntryDao getCartEntryDao()
-
setCartEntryDao
public void setCartEntryDao(CartEntryDao cartEntryDao)
-
getCommerceCartCalculationStrategy
protected CommerceCartCalculationStrategy getCommerceCartCalculationStrategy()
-
setCommerceCartCalculationStrategy
public void setCommerceCartCalculationStrategy(CommerceCartCalculationStrategy commerceCartCalculationStrategy)
-
-