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 ConfigurationFacade.
  • 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 cart
      productCode - code of product to add
      quantity - quantity to add
      Returns:
      CartModificationData
      Throws:
      CommerceCartModificationException - in case the update of the cart failed
    • updateProductConfigurationInCart

      CartModificationData updateProductConfigurationInCart(String productCode, String configId)
      Updates the current configuration in shopping cart.
      Parameters:
      productCode - code of product to add
      configId - configuration to add to the shopping cart
      Returns:
      CartModificationData
    • removeConfigurationLink

      void removeConfigurationLink(String productCode)
      Clears the link from a product to a runtime configuration
      Parameters:
      productCode - ID of a product
    • isItemInCartByKey

      boolean isItemInCartByKey(String key)
      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

      void resetConfiguration(String configId)
      Resets the configuration to the initial state
      Parameters:
      configId - ID of existing configuration
    • restoreConfiguration

      ConfigurationData restoreConfiguration(KBKeyData kbKey, String cartEntryKey)
      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 key
      cartEntryKey - cart entry key
      Returns:
      Configuration runtime object. Null if configuration could not be restored
    • configureCartItem

      default ConfigurationData configureCartItem(String cartItemKey)
      Returns the runtime configuration for a configurable cart item. May return null in case the runtime configuration is not available (anymore). Callers should check for null and take appropriate action.
      Parameters:
      cartItemKey - key of the cart item for which the runtime configuration should be retrieved
      Returns:
      runtime configuration, or null if 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 generated
      kbKey - knowledgebase for the product
      configId - configuration runtime id for the configuration attached to the cart item
      copyRequired - should the configuration be copied
      extConfig - external configuration associated with the configId
      Returns:
      draft configuration data
    • configureCartItemOnExistingDraft

      ConfigurationData configureCartItemOnExistingDraft(String cartEntryKey)
      Returns the runtime configuration for a configurable cart item, assuming that a configuration draft already exists! May return null in case the runtime configuration is not available (anymore). Callers should check for null and take appropriate action.
      Parameters:
      cartEntryKey - PK of cart entry as String
      Returns:
      Configuration in DTO representation