Interface BroadleafProductService<P extends Product>

All Known Implementing Classes:
DefaultBroadleafProductService

public interface BroadleafProductService<P extends Product>
Author:
Chris Kittrell (ckittrell)
  • Method Summary

    Modifier and Type
    Method
    Description
    determineDependentItemKey(@NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem, P product, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Determines the item key for the dependent cart item.
    determineVariant(com.broadleafcommerce.cart.client.domain.CartItem cartItem, P product)
    Attempt to determine the variant by the requested variant ID on the CartItem.
  • Method Details

    • determineVariant

      @Nullable Variant determineVariant(com.broadleafcommerce.cart.client.domain.CartItem cartItem, P product)
      Attempt to determine the variant by the requested variant ID on the CartItem. Otherwise, if any of the Product's Options are marked as ProductOptionType.VARIANT_DISTINGUISHING, we need to determine the Variant for the CartItem using the CartItem.getAttributeChoices().
      Parameters:
      cartItem - The cart item to determine the variant for.
      product - The Product containing options and variants.
    • determineDependentItemKey

      String determineDependentItemKey(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem dependantCartItem, @NonNull P product, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Determines the item key for the dependent cart item.
      Parameters:
      dependantCartItem - The dependent cart item whose item key is being determined
      product - The product of the parent cart item
      Returns:
      the item key for the dependent item