Class DefaultBroadleafProductService<P extends Product>
- java.lang.Object
-
- com.broadleafcommerce.cartoperation.service.mapping.DefaultBroadleafProductService<P>
-
- All Implemented Interfaces:
BroadleafProductService<P>
public class DefaultBroadleafProductService<P extends Product> extends Object implements BroadleafProductService<P>
- Author:
- Chris Kittrell (ckittrell)
-
-
Constructor Summary
Constructors Constructor Description DefaultBroadleafProductService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringdetermineDependentItemKey(@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.VariantdetermineVariant(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, P product)Attempt to determine the variant by the requested variant ID on theCartItem.protected booleanhasVariantDistinguishingOptions(P product)
-
-
-
Method Detail
-
determineVariant
@Nullable public Variant determineVariant(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull P product)
Description copied from interface:BroadleafProductServiceAttempt 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().- Specified by:
determineVariantin interfaceBroadleafProductService<P extends Product>- Parameters:
cartItem- The cart item to determine the variant for.product- TheProductcontaining options and variants.
-
determineDependentItemKey
public 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.- Specified by:
determineDependentItemKeyin interfaceBroadleafProductService<P extends Product>- Parameters:
product- The product of the parent cart itemdependantCartItem- The dependent cart item whose item key is being determined- Returns:
- the item key for the dependent item
-
hasVariantDistinguishingOptions
protected boolean hasVariantDistinguishingOptions(@NonNull P product)
-
-