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 Object
  • 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 cart
      productModel - the product in the cart
      quantityToAdd - the amount to increase the quantity of the product in the cart, may be negative if the request is to reduce the quantity
      pointOfServiceModel - 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 cart
      productModel - the product in the cart
      pointOfServiceModel - the PointOfService to check stock at, can be null
      quantityToAdd - 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(Integer maxOrderQuantity)
    • normalizeEntryNumbers

      protected void normalizeEntryNumbers(CartModel cartModel)
    • isOrderEntryUpdatable

      protected boolean isOrderEntryUpdatable(AbstractOrderEntryModel entryToUpdate)
    • getEntryForNumber

      protected AbstractOrderEntryModel getEntryForNumber(AbstractOrderModel order, int number)
    • getEntryForProductAndPointOfService

      protected 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)