public class DefaultCartItemProductService extends Object implements CartItemProductService
Constructor and Description |
---|
DefaultCartItemProductService(CartItemConfigurationService cartItemConfigurationService,
List<CartItemProductMapper> cartItemProductMappers,
CartOperationServiceProperties properties) |
Modifier and Type | Method and Description |
---|---|
protected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> |
buildItemAttributeChoices(@NonNull Map<String,String> requestItemAttributeChoices) |
protected com.broadleafcommerce.pricing.client.domain.PriceInfo |
cleanPriceInfo(@NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
Exclude
PriceableTarget information from the PriceInfo as it's unnecessary to
calculate pricing. |
protected CartItemConfigurationService |
getCartItemConfigurationService() |
protected List<CartItemProductMapper> |
getCartItemProductMappers() |
protected Set<String> |
getCategoryIdsForProduct(@NonNull Product product) |
protected String |
getDataDrivenEnumId(DataDrivenEnum dataDrivenEnum) |
protected com.broadleafcommerce.cart.client.domain.ImageAssetRef |
getImageAssetForProduct(@NonNull Product product) |
protected com.broadleafcommerce.cart.client.domain.ImageAssetRef |
getImageAssetForVariant(@NonNull Variant variant,
@NonNull Product product) |
protected String |
getPricingKey(Product product,
com.broadleafcommerce.cart.client.domain.CartItem cartItem)
Returns the product price key, if specified, otherwise retrieves it from the cart item or
generates a new one.
|
protected CartOperationServiceProperties |
getProperties() |
protected void |
populateAttributeChoiceLabelsFromOptions(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product) |
protected void |
populateDependentItemInformation(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull List<Product> products,
boolean isAdd)
Deprecated.
|
protected void |
populateDependentItemInformation(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
@NonNull List<Product> products,
boolean isAdd,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) |
com.broadleafcommerce.cart.client.domain.CartItem |
populateProductInformation(com.broadleafcommerce.cart.client.domain.CartItem cartItem,
Product product,
List<Product> productList,
boolean isAdd)
Populate product information within the
CartItem based on the provided
product |
com.broadleafcommerce.cart.client.domain.CartItem |
populateProductInformation(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Product product,
List<Product> productList,
boolean isAdd,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Populate product information within the
CartItem based on the provided
product and the merchandising context |
protected void |
populateVariantInformation(@NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem,
@NonNull Variant variant,
Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> skuPriceInfos) |
public DefaultCartItemProductService(CartItemConfigurationService cartItemConfigurationService, List<CartItemProductMapper> cartItemProductMappers, CartOperationServiceProperties properties)
public com.broadleafcommerce.cart.client.domain.CartItem populateProductInformation(com.broadleafcommerce.cart.client.domain.CartItem cartItem, Product product, List<Product> productList, boolean isAdd)
CartItemProductService
CartItem
based on the provided
productpopulateProductInformation
in interface CartItemProductService
cartItem
- The CartItem that is to be updated with product dataproduct
- The product that this CartItem is intended to representproductList
- The products that were retrieved for the add-to-cart, including dependent
item productsisAdd
- Whether we are in an add-to-cart flowpublic com.broadleafcommerce.cart.client.domain.CartItem populateProductInformation(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, List<Product> productList, boolean isAdd, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
CartItemProductService
CartItem
based on the provided
product and the merchandising contextpopulateProductInformation
in interface CartItemProductService
cartItem
- The CartItem that is to be updated with product dataproduct
- The product that this CartItem is intended to representproductList
- The products that were retrieved for the add-to-cart, including dependent
item productsisAdd
- Whether we are in an add-to-cart flowcontextInfo
- Context information around sandbox and multitenant state@Nullable protected String getDataDrivenEnumId(@Nullable DataDrivenEnum dataDrivenEnum)
protected com.broadleafcommerce.pricing.client.domain.PriceInfo cleanPriceInfo(@NonNull @NonNull com.broadleafcommerce.pricing.client.domain.PriceInfo priceInfo)
PriceableTarget
information from the PriceInfo
as it's unnecessary to
calculate pricing.priceInfo
- The price info to clean up for addition to CartItem attributesprotected String getPricingKey(Product product, com.broadleafcommerce.cart.client.domain.CartItem cartItem)
DefaultProductType.MERCHANDISING_PRODUCT
as it doesn't have the SKU and pricing key.product
- the product to get the pricing key fromcartItem
- the cart item to get the pricing key from@Nullable protected com.broadleafcommerce.cart.client.domain.ImageAssetRef getImageAssetForProduct(@NonNull @NonNull Product product)
@Nullable protected com.broadleafcommerce.cart.client.domain.ImageAssetRef getImageAssetForVariant(@NonNull @NonNull Variant variant, @NonNull @NonNull Product product)
protected Set<String> getCategoryIdsForProduct(@NonNull @NonNull Product product)
protected void populateVariantInformation(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Variant variant, Map<String,com.broadleafcommerce.pricing.client.domain.PriceInfo> skuPriceInfos)
protected Map<String,com.broadleafcommerce.order.common.domain.AttributeChoiceValue> buildItemAttributeChoices(@NonNull @NonNull Map<String,String> requestItemAttributeChoices)
protected void populateAttributeChoiceLabelsFromOptions(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product)
@Deprecated protected void populateDependentItemInformation(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, boolean isAdd)
protected void populateDependentItemInformation(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.CartItem cartItem, @NonNull @NonNull Product product, @NonNull @NonNull List<Product> products, boolean isAdd, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
protected CartItemConfigurationService getCartItemConfigurationService()
protected List<CartItemProductMapper> getCartItemProductMappers()
protected CartOperationServiceProperties getProperties()
Copyright © 2021. All rights reserved.