Class DefaultCartIntegrationFacade
java.lang.Object
de.hybris.platform.cpq.productconfig.facades.impl.DefaultCartIntegrationFacade
- All Implemented Interfaces:
CartIntegrationFacade
Default implementation of
CartIntegrationFacade-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCartIntegrationFacade(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. -
Method Summary
Modifier and TypeMethodDescriptionaddConfigurationToCart(String configId, long quantity) Adds the current CPQ configuration to shopping cart.protected CommerceCartModificationcreateCartItem(ProductModel product, CartModel cart, String configId, long quantity) protected CommerceCartModificationfillCommerceCartModification(AbstractOrderEntryModel entryToUpdate) protected AbstractOrderIntegrationServiceprotected de.hybris.platform.servicelayer.dto.converter.Converter<CommerceCartModification,CartModificationData> protected de.hybris.platform.order.CartServiceprotected de.hybris.platform.commerceservices.order.CommerceCartServicegetConfigIdForSessionCartEntry(Integer entryNumber) Gets configuration ID that is assigned to the cart entry specified by the entry number providedprotected ConfigurationServiceprotected de.hybris.platform.servicelayer.model.ModelServicegetProductCodeForSessionCartEntry(Integer entryNumber) Gets product code that is assigned to the cart entry specified by the entry number providedprotected de.hybris.platform.product.ProductServiceprotected StringgetRootProduct(String configId) protected voidinvalidateConfigurationSummaryCache(String configId) protected voidlogFacadeCallDone(String operation, long startTime) protected longlogFacadeCallStart(String format, Object... args) protected CommerceCartParameterprepareCommerceCartParameterForAddToCart(CartModel cart, ProductModel product, long quantity, boolean forceNewEntry, String configId) protected voidrecalculateCart(int cartEntryNumber) protected voidremoveObsoleteConfiguration(String obsoleteConfigId) updateCartEntryFromConfiguration(String configId, int cartEntryNumber) Updates cart entry (prices, configuration summary) from the configuration attached to it
-
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 servicemodelService- model servicecommerceCartService- commerce cart serviceproductService- product serviceconfigurationService- configuration serviceabstractOrderIntegrationService- Used for retrieving the configuration ID per configurable entrycartModificationConverter- 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:CartIntegrationFacadeAdds the current CPQ configuration to shopping cart.- Specified by:
addConfigurationToCartin interfaceCartIntegrationFacade- Parameters:
configId- configuration id to add to the shopping cartquantity- 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
-
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
-
logFacadeCallDone
-
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
-
getConfigIdForSessionCartEntry
Description copied from interface:CartIntegrationFacadeGets configuration ID that is assigned to the cart entry specified by the entry number provided- Specified by:
getConfigIdForSessionCartEntryin interfaceCartIntegrationFacade- Parameters:
entryNumber- Cart entry number- Returns:
- ProductConfigData containing the CPQ configuration ID
-
getProductCodeForSessionCartEntry
Description copied from interface:CartIntegrationFacadeGets product code that is assigned to the cart entry specified by the entry number provided- Specified by:
getProductCodeForSessionCartEntryin interfaceCartIntegrationFacade- Parameters:
entryNumber- Cart entry number- Returns:
- product code
-
updateCartEntryFromConfiguration
Description copied from interface:CartIntegrationFacadeUpdates cart entry (prices, configuration summary) from the configuration attached to it- Specified by:
updateCartEntryFromConfigurationin interfaceCartIntegrationFacade- Parameters:
configId- Configuration identifiercartEntryNumber- Cart entry number- Returns:
- cart modification data containing modified cart entry
-
fillCommerceCartModification
protected CommerceCartModification fillCommerceCartModification(AbstractOrderEntryModel entryToUpdate) -
removeObsoleteConfiguration
-
invalidateConfigurationSummaryCache
-
recalculateCart
protected void recalculateCart(int cartEntryNumber) -
getAbstractOrderIntegrationService
-
getCartModificationConverter
protected de.hybris.platform.servicelayer.dto.converter.Converter<CommerceCartModification,CartModificationData> getCartModificationConverter()
-