public class DefaultItemListAddToCartService extends Object implements ItemListAddToCartService
Modifier and Type | Field and Description |
---|---|
protected static String |
ITEM_LIST_ITEM_ID |
Constructor and Description |
---|
DefaultItemListAddToCartService(ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> securityService,
ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> itemService,
CartOperationService cartOpService,
ItemListAddToCartProperties properties,
com.broadleafcommerce.common.extension.TypeFactory typeFactory) |
Modifier and Type | Method and Description |
---|---|
protected ItemListAddToCartResponse |
addAccessibleItemListsToCart(com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef,
Set<String> itemListIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
After verifying the user's access to the set of
ItemList ids, add the lists's items
to the cart. |
protected ItemListAddToCartResponse |
addAccessibleItemListToCart(com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef,
String itemListId,
boolean shouldPriceCart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
After verifying the user's access to the
ItemList , add the list's items to the cart. |
ItemListAddToCartResponse |
addItemListsToCart(com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef,
Set<String> itemListIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Adds all
ItemListItems to the cart from the ItemLists
identified by the provided itemListIds |
ItemListAddToCartResponse |
addItemListToCart(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef,
String itemListId,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Adds all
ItemListItems to the cart from the ItemList identified
by the provided itemListId |
protected BulkAddToCartResponse |
addItemsToCart(com.broadleafcommerce.cart.client.domain.Cart cart,
@NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef,
org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.ItemListItem> itemPage,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Responsible for adding the provided ItemListItem page to the cart
|
protected List<AddItemRequest> |
buildAddItemRequests(org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.ItemListItem> itemPage,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Responsible for creating AddItemRequests based on the provided ItemListItem page
|
protected CartOperationService |
getCartOpService() |
protected CartPricingService |
getCartPricingService()
Deprecated.
since 1.6, use
getCartOpService() instead |
protected List<String> |
getFailedItemAdditions(List<AddItemFailure> addItemFailures)
Identifies the
ItemListItem ids related to the failed AddItemRequests . |
protected ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> |
getItemService() |
protected ItemListAddToCartProperties |
getProperties() |
protected ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> |
getSecurityService() |
protected com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
protected static final String ITEM_LIST_ITEM_ID
public DefaultItemListAddToCartService(ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> securityService, ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> itemService, CartOperationService cartOpService, ItemListAddToCartProperties properties, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
public ItemListAddToCartResponse addItemListToCart(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, String itemListId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ItemListAddToCartService
ItemListItems
to the cart from the ItemList
identified
by the provided itemListIdaddItemListToCart
in interface ItemListAddToCartService
cart
- The cart that is to be added tocustomerRef
- The current customer & owner of the cartitemListId
- The id of the ItemList that is to be added to cartcontextInfo
- The context of the current requestpublic ItemListAddToCartResponse addItemListsToCart(@Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, Set<String> itemListIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ItemListAddToCartService
ItemListItems
to the cart from the ItemLists
identified by the provided itemListIdsaddItemListsToCart
in interface ItemListAddToCartService
cart
- The cart that is to be added tocustomerRef
- The current customer & owner of the cartitemListIds
- The ids of the ItemLists that are to be added to cartcontextInfo
- The context of the current requestprotected ItemListAddToCartResponse addAccessibleItemListsToCart(@Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, Set<String> itemListIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ItemList
ids, add the lists's items
to the cart.
Note: We intentionally avoid pricing the cart until after all of the items have been added to
cartcart
- The cart that is being added tocustomerRef
- The cart's owning useritemListIds
- List of ItemList
ids that should be added to the cartcontextInfo
- The context of the user's requestprotected ItemListAddToCartResponse addAccessibleItemListToCart(@Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, String itemListId, boolean shouldPriceCart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ItemList
, add the list's items to the cart.cart
- The cart that is being added tocustomerRef
- The cart's owning useritemListId
- Id of the ItemList
that should be added to the cartcontextInfo
- The context of the user's requestprotected BulkAddToCartResponse addItemsToCart(@Nullable com.broadleafcommerce.cart.client.domain.Cart cart, @NonNull @NonNull com.broadleafcommerce.cart.client.domain.CustomerRef customerRef, org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.ItemListItem> itemPage, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
cart
- The cart that is being added tocustomerRef
- The cart's owning useritemPage
- Page of ItemListItems that are to be added to cartcontextInfo
- The context of the user's requestprotected List<AddItemRequest> buildAddItemRequests(org.springframework.data.domain.Page<com.broadleafcommerce.cart.client.domain.ItemListItem> itemPage, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
itemPage
- Page of ItemListItems that are to be added to cartcontextInfo
- The context of the user's requestprotected List<String> getFailedItemAdditions(List<AddItemFailure> addItemFailures)
ItemListItem
ids related to the failed AddItemRequests
.addItemFailures
- The list of items that failed add to cartprotected ItemListSecurityService<com.broadleafcommerce.cart.client.domain.ItemListAccessRule> getSecurityService()
protected ItemListItemManagementService<com.broadleafcommerce.cart.client.domain.ItemListItem> getItemService()
protected CartOperationService getCartOpService()
@Deprecated protected CartPricingService getCartPricingService()
getCartOpService()
insteadprotected ItemListAddToCartProperties getProperties()
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
Copyright © 2021. All rights reserved.