Interface ConfigurationCartIntegrationFacade

    • Method Detail

      • addConfigurationToCart

        java.lang.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​(java.lang.String productCode,
                                                           java.lang.Long quantity,
                                                           java.lang.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​(java.lang.String productCode,
                                                              java.lang.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​(java.lang.String productCode)
        Clears the link from a product to a runtime configuration
        Parameters:
        productCode - ID of a product
      • isItemInCartByKey

        boolean isItemInCartByKey​(java.lang.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
      • copyConfiguration

        @Deprecated(since="1808",
                    forRemoval=true)
        java.lang.String copyConfiguration​(java.lang.String configId,
                                           java.lang.String productCode)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Copies a configuration. The implementation can decide if a deep copy is needed; if not, the input ID is simply returned.
        Parameters:
        configId - ID of existing configuration
        productCode - product code of configurable product to be copied
        Returns:
        ID of new configuration if a deep copy was performed; input otherwise
      • resetConfiguration

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

        ConfigurationData restoreConfiguration​(KBKeyData kbKey,
                                               java.lang.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
      • findItemInCartByPK

        @Deprecated(since="1808",
                    forRemoval=true)
        default AbstractOrderEntryModel findItemInCartByPK​(PK cartItemPk)
        Deprecated, for removal: This API element is subject to removal in a future version.
        since 18.08.0 - please read any cart related data via the CartFacade CartFacade.getSessionCart()
        Searches the session cart for an entry specified by a primary key. In case nothing is found, null is returned.
        Parameters:
        cartItemPk - Entry key
        Returns:
        Corresponding order entry model
      • configureCartItem

        default ConfigurationData configureCartItem​(java.lang.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​(java.lang.String cartItemHandle,
                                      KBKeyData kbKey,
                                      java.lang.String configId,
                                      boolean copyRequired,
                                      java.lang.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​(java.lang.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