Interface BroadleafProductService<P extends Product>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      String 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.
      Variant determineVariant​(com.broadleafcommerce.cart.client.domain.CartItem cartItem, P product)
      Attempt to determine the variant by the requested variant ID on the CartItem.
    • Method Detail

      • 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