Class DefaultCartIntegrationFacade

java.lang.Object
de.hybris.platform.cpq.productconfig.facades.impl.DefaultCartIntegrationFacade
All Implemented Interfaces:
CartIntegrationFacade

public class DefaultCartIntegrationFacade extends Object implements CartIntegrationFacade
Default implementation of CartIntegrationFacade
  • Constructor Details

    • DefaultCartIntegrationFacade

      public DefaultCartIntegrationFacade(de.hybris.platform.order.CartService cartService, de.hybris.platform.servicelayer.model.ModelService modelService, de.hybris.platform.commerceservices.order.CommerceCartService commerceCartService, de.hybris.platform.product.ProductService productService, ConfigurationService configurationService, AbstractOrderIntegrationService abstractOrderIntegrationService, de.hybris.platform.servicelayer.dto.converter.Converter<CommerceCartModification,CartModificationData> cartModificationConverter)
      Default Constructor. Expects all required dependencies as constructor args
      Parameters:
      cartService - cart service
      modelService - model service
      commerceCartService - commerce cart service
      productService - product service
      configurationService - configuration service
      abstractOrderIntegrationService - Used for retrieving the configuration ID per configurable entry
      cartModificationConverter - converts commerce- into cartModificationdata
  • Method Details

    • addConfigurationToCart

      public CartModificationData addConfigurationToCart(String configId, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Description copied from interface: CartIntegrationFacade
      Adds the current CPQ configuration to shopping cart.
      Specified by:
      addConfigurationToCart in interface CartIntegrationFacade
      Parameters:
      configId - configuration id to add to the shopping cart
      quantity - quantity of the cart entry
      Returns:
      cart modification data containing modified cart entry
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException - in case adding to cart failed
    • getRootProduct

      protected String getRootProduct(String configId)
    • createCartItem

      protected CommerceCartModification createCartItem(ProductModel product, CartModel cart, String configId, long quantity) throws de.hybris.platform.commerceservices.order.CommerceCartModificationException
      Throws:
      de.hybris.platform.commerceservices.order.CommerceCartModificationException
    • prepareCommerceCartParameterForAddToCart

      protected CommerceCartParameter prepareCommerceCartParameterForAddToCart(CartModel cart, ProductModel product, long quantity, boolean forceNewEntry, String configId)
    • logFacadeCallStart

      protected long logFacadeCallStart(String format, Object... args)
    • logFacadeCallDone

      protected void logFacadeCallDone(String operation, long startTime)
    • getCartService

      protected de.hybris.platform.order.CartService getCartService()
    • getModelService

      protected de.hybris.platform.servicelayer.model.ModelService getModelService()
    • getCommerceCartService

      protected de.hybris.platform.commerceservices.order.CommerceCartService getCommerceCartService()
    • getProductService

      protected de.hybris.platform.product.ProductService getProductService()
    • getConfigurationService

      protected ConfigurationService getConfigurationService()
    • getConfigIdForSessionCartEntry

      public ProductConfigData getConfigIdForSessionCartEntry(Integer entryNumber)
      Description copied from interface: CartIntegrationFacade
      Gets configuration ID that is assigned to the cart entry specified by the entry number provided
      Specified by:
      getConfigIdForSessionCartEntry in interface CartIntegrationFacade
      Parameters:
      entryNumber - Cart entry number
      Returns:
      ProductConfigData containing the CPQ configuration ID
    • getProductCodeForSessionCartEntry

      public String getProductCodeForSessionCartEntry(Integer entryNumber)
      Description copied from interface: CartIntegrationFacade
      Gets product code that is assigned to the cart entry specified by the entry number provided
      Specified by:
      getProductCodeForSessionCartEntry in interface CartIntegrationFacade
      Parameters:
      entryNumber - Cart entry number
      Returns:
      product code
    • updateCartEntryFromConfiguration

      public CartModificationData updateCartEntryFromConfiguration(String configId, int cartEntryNumber)
      Description copied from interface: CartIntegrationFacade
      Updates cart entry (prices, configuration summary) from the configuration attached to it
      Specified by:
      updateCartEntryFromConfiguration in interface CartIntegrationFacade
      Parameters:
      configId - Configuration identifier
      cartEntryNumber - Cart entry number
      Returns:
      cart modification data containing modified cart entry
    • fillCommerceCartModification

      protected CommerceCartModification fillCommerceCartModification(AbstractOrderEntryModel entryToUpdate)
    • removeObsoleteConfiguration

      protected void removeObsoleteConfiguration(String obsoleteConfigId)
    • invalidateConfigurationSummaryCache

      protected void invalidateConfigurationSummaryCache(String configId)
    • recalculateCart

      protected void recalculateCart(int cartEntryNumber)
    • getAbstractOrderIntegrationService

      protected AbstractOrderIntegrationService getAbstractOrderIntegrationService()
    • getCartModificationConverter

      protected de.hybris.platform.servicelayer.dto.converter.Converter<CommerceCartModification,CartModificationData> getCartModificationConverter()