public interface OfferProvider
Cart
.Modifier and Type | Method and Description |
---|---|
void |
applyOffers(@NonNull com.broadleafcommerce.cart.client.domain.Cart cart,
boolean runOrderAndItemOffers,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Handles requests against the Offer Engine to retrieve and apply discounts for a
Cart
and its contents. |
void |
applyOffers(com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Handles requests against the Offer Engine to retrieve and apply discounts for a
Cart
and its contents. |
String |
getCodeUsabilityType(String code,
com.broadleafcommerce.cart.client.domain.Cart cart,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Determines the usability type of the promo
code in the context of the given
cart . |
com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult |
validateOfferAndOfferCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart,
List<String> offerCodes,
List<String> offerRefIds,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Retrieve validation information regarding the cart's usage of the provided offers and offer
codes to determine if the usage is still valid.
|
void applyOffers(com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
and its contents. This method should apply all kinds of offers applicable to the contents
including all order, order item, fulfillment, and fulfillment item offers.
To control whether order and order item offers are applied use
applyOffers(Cart, boolean, ContextInfo)
and set `runOrderAndItemOffers` as desired.
Set it to false
if you only want to run fulfillment and fulfillment item offers. By
default, fulfillment pricing occurs after order and order items have been priced and their
offers applied since fulfillment pricing and promotions can depend on the price of the
merchandise being fulfilled.
cart
- The Cart
whose contents to send to the offer engine for evaluationcontextInfo
- Additional sandbox and tenancy infovoid applyOffers(@NonNull @NonNull com.broadleafcommerce.cart.client.domain.Cart cart, boolean runOrderAndItemOffers, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Cart
and its contents. Allows specifying whether order and order item offers will be applied in
the calculation. Set runOrderAndItemOffers
to false
if you only want to run
fulfillment and fulfillment item offers.
By default, fulfillment pricing occurs after order and order items have been priced and their offers applied since fulfillment pricing and promotions can depend on the price of the merchandise being fulfilled. Thus, when fulfillment offers are processed, order and order item offers should not also be reprocessed or the results can be incorrect—this also makes the request run faster since only fulfillment will be considered.
cart
- The Cart
whose contents to send to the offer engine for evaluationrunOrderAndItemOffers
- Whether to have the Offer Engine run order and order item level
offers. Set this to false
if you only want to run fulfillment and fulfillment
item offers. By default, fulfillment pricing occurs after order and order items have
been priced and their offers applied since fulfillment pricing and promotions can
depend on the price of the merchandise being fulfilled.contextInfo
- Additional sandbox and tenancy infoString getCodeUsabilityType(String code, com.broadleafcommerce.cart.client.domain.Cart cart, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
code
in the context of the given
cart
. Possible values are defined in CodeUsabilityType
and include whether
the code is usable, cannot be used because it has reached its max uses limit, or cannot be
used because it does not match any offers (may be a campaign code or some other type in this
case).code
- The promo code to apply to cart
cart
- The Cart
that promo code
is to be applied tocontextInfo
- Additional sandbox and tenancy infoCodeUsabilityType
com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateOfferAndOfferCodeUsages(com.broadleafcommerce.cart.client.domain.Cart cart, List<String> offerCodes, List<String> offerRefIds, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
cart
- The cart against which to validate offer and code uses.offerCodes
- The codes to check for validity.offerRefIds
- The offer ids to check for validity.contextInfo
- Context information around sandbox and multitenant state.Copyright © 2021. All rights reserved.