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_ITEMS
public 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 Cart
CartAttributeConstants.Internal#FREE_GIFT_OFFER_ITEMS
public List<String> getOfferIdsToIgnore(com.broadleafcommerce.cart.client.domain.Cart cart)
Cart
.cart
- the Cart
to retrieve the ignored offer ids fromCart
CartAttributeConstants.Internal#OFFER_IDS_TO_IGNORE
public 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_IGNORE
public 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.