public class CartOfferUtils extends Object
Cart.| Constructor and Description |
|---|
CartOfferUtils(CartItemOfferUtils cartItemOfferUtils) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCartItemQualifiedOfferIdsToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
Retrieves the offer ids that the given
CartItems that are qualifiers of and
add them to the given Cart's offer ignore list. |
List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> |
getFreeGiftItemsFromOffers(com.broadleafcommerce.cart.client.domain.Cart cart)
Retrieves the
FreeGiftItems applicable to the given Cart. |
List<String> |
getOfferIdsToIgnore(com.broadleafcommerce.cart.client.domain.Cart cart)
Retrieves the offer ids to ignore and not apply to the given
Cart. |
boolean |
offerShouldBeIgnored(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef offerRef)
Determines if the given
OfferRef should be ignored for the given Cart. |
void |
storeFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItems)
Adds the given
FreeGiftItems to Cart.getInternalAttributes() for
later processing. |
public CartOfferUtils(CartItemOfferUtils cartItemOfferUtils)
public void storeFreeGiftItems(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> freeGiftItems)
FreeGiftItems to Cart.getInternalAttributes() for
later processing.cart - the Cart to add the FreeGiftItems forfreeGiftItems - the FreeGiftItems to add to
Cart.getInternalAttributes()CartAttributeConstants.Internal#FREE_GIFT_OFFER_ITEMSpublic List<com.broadleafcommerce.promotion.offer.client.web.context.info.FreeGiftItem> getFreeGiftItemsFromOffers(com.broadleafcommerce.cart.client.domain.Cart cart)
FreeGiftItems applicable to the given Cart.cart - the Cart to retrieve the applicable FreeGiftItems
fromFreeGiftItems applicable to the given CartCartAttributeConstants.Internal#FREE_GIFT_OFFER_ITEMSpublic List<String> getOfferIdsToIgnore(com.broadleafcommerce.cart.client.domain.Cart cart)
Cart.cart - the Cart to retrieve the ignored offer ids fromCartCartAttributeConstants.Internal#OFFER_IDS_TO_IGNOREpublic boolean offerShouldBeIgnored(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.promotion.offer.client.web.context.info.OfferRef offerRef)
OfferRef should be ignored for the given Cart.cart - the Cart to check againstofferRef - the OfferRef to check againstOfferRef should be ignored, otherwise falseCartAttributeConstants.Internal#OFFER_IDS_TO_IGNOREpublic void addCartItemQualifiedOfferIdsToIgnoreList(com.broadleafcommerce.cart.client.domain.Cart cart,
List<com.broadleafcommerce.cart.client.domain.CartItem> cartItems)
CartItems that are qualifiers of and
add them to the given Cart's offer ignore list.
This is typically used when removing automatically added CartItems from
offers, but no longer want to apply those offers again.
cart - the Cart to add the offer ids to ignore forcartItems - the CartItems to retrieve their qualified offer ids forCopyright © 2021. All rights reserved.