Interface BundleCartFacade

  • All Known Implementing Classes:
    DefaultBundleCommerceCartFacade

    public interface BundleCartFacade
    Bundle Cart facade interface. Service is responsible for getting and updating all necessary information for a bundle cart.
    • Method Detail

      • startBundle

        CartModificationData startBundle​(@Nonnull
                                         java.lang.String bundleTemplateId,
                                         @Nonnull
                                         java.lang.String productCode,
                                         long quantity)
                                  throws CommerceCartModificationException
        Start new bundle in cart based on the given bundle template and add the product to it.
        Parameters:
        bundleTemplateId - a component to add the product to. He whole bundle structure - starting from the root of the component - will be added to cart groups
        productCode - a product which will be added to the component
        quantity - quantity for the product. Is limited by selection criteria of the component
        Returns:
        information about the new cart entry
        Throws:
        CommerceCartModificationException - if the operation is not possible
        See Also:
        EntryGroup, BundleSelectionCriteria
      • addToCart

        CartModificationData addToCart​(@Nonnull
                                       java.lang.String productCode,
                                       long quantity,
                                       int groupNumber)
                                throws CommerceCartModificationException
        Add a product to an existing bundle.
        Parameters:
        productCode - product to add
        quantity - quantity of the product
        groupNumber - entry group number, that defines the bundle and the component within the bundle
        Returns:
        information about the new cart entry
        Throws:
        CommerceCartModificationException - if the operation is not possible
        See Also:
        EntryGroup
      • getAllowedProducts

        @Nonnull
        ProductSearchPageData<SearchStateData,​ProductData> getAllowedProducts​(@Nonnull
                                                                                    java.lang.Integer groupNumber,
                                                                                    java.lang.String searchQuery,
                                                                                    @Nonnull
                                                                                    PageableData pageableData)
        Constructs pageable list of products available for entry group of type GroupType.CONFIGURABLEBUNDLE
        Parameters:
        groupNumber - entry group number related to the component
        searchQuery - the search query
        pageableData - the page to return
        Returns:
        the search results
        Throws:
        java.lang.IllegalArgumentException - if group is not found or group type is not GroupType.CONFIGURABLEBUNDLE