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 -
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(@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)
-
Constructor Details
-
DefaultBroadleafProductService
public DefaultBroadleafProductService()
-
-
Method Details
-
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
-