Interface ConfigurationCartIntegrationFacade
- All Known Implementing Classes:
ConfigurationCartIntegrationFacadeImpl
public interface ConfigurationCartIntegrationFacade
Facade containing for integration between the shopping cart and configurable products.
Pure configuration related behavior is handled by the
Pure configuration related behavior is handled by the
ConfigurationFacade.-
Method Summary
Modifier and TypeMethodDescriptionaddConfigurationToCart(ConfigurationData configuration) Adds the current configuration to shopping cart.addProductConfigurationToCart(String productCode, Long quantity, String configId) Adds the current configuration to shopping cart.default ConfigurationDataconfigureCartItem(String cartItemKey) Returns the runtime configuration for a configurable cart item.configureCartItemOnExistingDraft(String cartEntryKey) Returns the runtime configuration for a configurable cart item, assuming that a configuration draft already exists! May returnnullin case the runtime configuration is not available (anymore).draftConfig(String cartItemHandle, KBKeyData kbKey, String configId, boolean copyRequired, String extConfig) Creates a draft from the given external configuration for the associated cart itembooleanisItemInCartByKey(String key) Checks whether item is in cartvoidremoveConfigurationLink(String productCode) Clears the link from a product to a runtime configurationvoidresetConfiguration(String configId) Resets the configuration to the initial staterestoreConfiguration(KBKeyData kbKey, String cartEntryKey) Restores a configuration from a cart entry specified by its key.updateProductConfigurationInCart(String productCode, String configId) Updates the current configuration in shopping cart.
-
Method Details
-
addConfigurationToCart
String addConfigurationToCart(ConfigurationData configuration) throws CommerceCartModificationException Adds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Parameters:
configuration- configuration to add to the shopping cart- Returns:
- key/handle to re-identify the item within the session
- Throws:
CommerceCartModificationException- in case the update of the cart failed
-
addProductConfigurationToCart
CartModificationData addProductConfigurationToCart(String productCode, Long quantity, String configId) throws CommerceCartModificationException Adds the current configuration to shopping cart. The configuration is attached to the shopping cart item as external configuration, which is an XML-String.- Parameters:
configId- configuration to add to the shopping cartproductCode- code of product to addquantity- quantity to add- Returns:
- CartModificationData
- Throws:
CommerceCartModificationException- in case the update of the cart failed
-
updateProductConfigurationInCart
Updates the current configuration in shopping cart.- Parameters:
productCode- code of product to addconfigId- configuration to add to the shopping cart- Returns:
- CartModificationData
-
removeConfigurationLink
Clears the link from a product to a runtime configuration- Parameters:
productCode- ID of a product
-
isItemInCartByKey
Checks whether item is in cart- Parameters:
key- /handle to re-identify the item within the session- Returns:
true, only if the item is in the cart
-
resetConfiguration
Resets the configuration to the initial state- Parameters:
configId- ID of existing configuration
-
restoreConfiguration
Restores a configuration from a cart entry specified by its key. This is needed if there is no SSC session connected to the cart entry yet.- Parameters:
kbKey- knowledgebase keycartEntryKey- cart entry key- Returns:
- Configuration runtime object. Null if configuration could not be restored
-
configureCartItem
Returns the runtime configuration for a configurable cart item. May returnnullin case the runtime configuration is not available (anymore). Callers should check fornulland take appropriate action.- Parameters:
cartItemKey- key of the cart item for which the runtime configuration should be retrieved- Returns:
- runtime configuration, or
nullif not available anymore
-
draftConfig
ConfigurationData draftConfig(String cartItemHandle, KBKeyData kbKey, String configId, boolean copyRequired, String extConfig) Creates a draft from the given external configuration for the associated cart item- Parameters:
cartItemHandle- cart item for which a draft is to be generatedkbKey- knowledgebase for the productconfigId- configuration runtime id for the configuration attached to the cart itemcopyRequired- should the configuration be copiedextConfig- external configuration associated with the configId- Returns:
- draft configuration data
-
configureCartItemOnExistingDraft
Returns the runtime configuration for a configurable cart item, assuming that a configuration draft already exists! May returnnullin case the runtime configuration is not available (anymore). Callers should check fornulland take appropriate action.- Parameters:
cartEntryKey- PK of cart entry as String- Returns:
- Configuration in DTO representation
-