Interface BroadleafProductService<P extends Product>
- All Known Implementing Classes:
DefaultBroadleafProductService
public interface BroadleafProductService<P extends Product>
- Author:
- Chris Kittrell (ckittrell)
-
Method Summary
Modifier and TypeMethodDescriptiondetermineDependentItemKey(@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 theCartItem.
-
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 theCartItem. Otherwise, if any of theProduct's Optionsare marked asProductOptionType.VARIANT_DISTINGUISHING, we need to determine theVariantfor theCartItemusing theCartItem.getAttributeChoices().- Parameters:
cartItem- The cart item to determine the variant for.product- TheProductcontaining 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 determinedproduct- The product of the parent cart item- Returns:
- the item key for the dependent item
-