Class ItemChoiceAvailabilityConsolidationContributor

java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.ItemChoiceAvailabilityConsolidationContributor
All Implemented Interfaces:
ProductConsolidationContributor

public class ItemChoiceAvailabilityConsolidationContributor extends Object implements ProductConsolidationContributor
Performs logic to handle if a product with required item choices has all item choices available for purchase. This handles item bundles to determine if the product has enough available items in order to .
  • Constructor Details

  • Method Details

    • consolidateProducts

      public void consolidateProducts(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Description copied from interface: ProductConsolidationContributor
      Consolidate products with their related domain and translations. This includes both hydrating Product fields and combining external references like CategoryProduct. Any catalog or sandbox overrides made to external references for non-overridden products will generate new placeholder products to store those overrides.
      Specified by:
      consolidateProducts in interface ProductConsolidationContributor
      Parameters:
      productIds - the IDs of the products to consolidate
      products - the product in all explicit context states
      inheritanceLines - the catalog inheritance lines top-down from all of the products
      context - context information surrounding sandboxing/multitenant state
    • checkBundleProductsAvailable

      protected void checkBundleProductsAvailable(List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • hydrateBundleProducts

      protected void hydrateBundleProducts(List<ConsolidatedProduct> bundleProducts, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • determineItemsInBundleAvailable

      protected void determineItemsInBundleAvailable(ConsolidatedProduct consolidatedProduct, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • getProductsWithRequiredItems

      protected List<ConsolidatedProduct> getProductsWithRequiredItems(List<ConsolidatedProduct> products)
    • determineRequiredItemChoicesAvailable

      protected void determineRequiredItemChoicesAvailable(List<ConsolidatedProduct> productsWithRequiredItemChoices, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    • isItemAvailableInCategory

      @Deprecated protected boolean isItemAvailableInCategory(ProductOption productOption, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      This is assumed to be true for the purposes of indexing. As of 1.5.0-GA.
    • hydrateCategoryProducts

      protected void hydrateCategoryProducts(org.springframework.data.domain.Page<CategoryProduct> categoryProducts, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • checkForProductsInRuleBasedCategory

      @Deprecated protected boolean checkForProductsInRuleBasedCategory(String categoryId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deprecated.
      This is assumed to be true for the purposes of indexing. As of 1.5.0-GA.
    • isSpecificProductAvailable

      protected boolean isSpecificProductAvailable(ProductOption productOption)
      If 1 product is available in a bundle, even if that bundle has a minimum quantity of greater than 1, we assume it is available. That's because, even if there's a minimum quantity of 2 and only 1 product is available, we can say that the customer could purchase 2 of the 1 available product.
      Parameters:
      productOption -
      Returns:
      true if at least one specific item choice is available, else false.
    • getProductService

      protected ProductService<Product> getProductService()
    • getCategoryProductService

      protected CategoryProductService<CategoryProduct> getCategoryProductService()
    • getCategoryService

      protected CategoryService<Category> getCategoryService()
    • getRsqlFilterParser

      protected com.broadleafcommerce.data.tracking.core.filtering.fetch.rsql.RSQLFilterParser getRsqlFilterParser()