Class AbstractCommerceCartStrategy
java.lang.Object
de.hybris.platform.commerceservices.order.impl.AbstractCommerceCartStrategy
- Direct Known Subclasses:
AbstractCommerceAddToCartStrategy,AbstractCommerceCloneSavedCartStrategy,AbstractCommerceFlagForDeletionStrategy,AbstractCommerceSaveCartStrategy,DefaultCommerceCartMergingStrategy,DefaultCommerceCartRestorationStrategy,DefaultCommerceCartSplitStrategy,DefaultCommerceUpdateCartEntryStrategy,DefaultSubscriptionCommerceCartStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final longprotected long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected longcheckCartLevel(ProductModel productModel, CartModel cartModel, PointOfServiceModel pointOfServiceModel) protected longgetAllowedCartAdjustmentForProduct(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.protected longgetAvailableStockLevel(ProductModel productModel, PointOfServiceModel pointOfServiceModel) protected BaseStoreServiceprotected CartEntryDaoprotected CartServiceprotected CommerceCartCalculationStrategyprotected CommerceStockServiceprotected AbstractOrderEntryModelgetEntryForNumber(AbstractOrderModel order, int number) protected IntegergetEntryForProductAndPointOfService(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel) protected ModifiableChecker<AbstractOrderEntryModel>protected longprotected ModelServiceprotected ProductServiceprotected booleanisMaxOrderQuantitySet(Integer maxOrderQuantity) protected booleanisOrderEntryUpdatable(AbstractOrderEntryModel entryToUpdate) protected booleanisStockLevelSufficient(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.protected voidnormalizeEntryNumbers(CartModel cartModel) voidsetBaseStoreService(BaseStoreService baseStoreService) voidsetCartEntryDao(CartEntryDao cartEntryDao) voidsetCartService(CartService cartService) voidsetCommerceCartCalculationStrategy(CommerceCartCalculationStrategy commerceCartCalculationStrategy) voidsetCommerceStockService(CommerceStockService commerceStockService) voidsetEntryOrderChecker(ModifiableChecker<AbstractOrderEntryModel> entryOrderChecker) voidsetForceInStockMaxQuantity(long forceInStockMaxQuantity) voidsetModelService(ModelService modelService) voidsetProductService(ProductService productService)
-
Field Details
-
DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY
protected static final long DEFAULT_FORCE_IN_STOCK_MAX_QUANTITY- See Also:
-
forceInStockMaxQuantity
protected long forceInStockMaxQuantity
-
-
Constructor Details
-
AbstractCommerceCartStrategy
public AbstractCommerceCartStrategy()
-
-
Method Details
-
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
-
normalizeEntryNumbers
-
isOrderEntryUpdatable
-
getEntryForNumber
-
getEntryForProductAndPointOfService
protected Integer getEntryForProductAndPointOfService(CartModel cartModel, ProductModel productModel, PointOfServiceModel pointOfServiceModel) -
getProductService
-
setProductService
-
getCartService
-
setCartService
-
getModelService
-
setModelService
-
getCommerceStockService
-
setCommerceStockService
-
getBaseStoreService
-
setBaseStoreService
-
getForceInStockMaxQuantity
protected long getForceInStockMaxQuantity() -
setForceInStockMaxQuantity
public void setForceInStockMaxQuantity(long forceInStockMaxQuantity) -
getEntryOrderChecker
-
setEntryOrderChecker
-
getCartEntryDao
-
setCartEntryDao
-
getCommerceCartCalculationStrategy
-
setCommerceCartCalculationStrategy
public void setCommerceCartCalculationStrategy(CommerceCartCalculationStrategy commerceCartCalculationStrategy)
-