Interface OfferServiceExtensionHandler
- All Superinterfaces:
org.broadleafcommerce.common.extension.ExtensionHandler
- All Known Implementing Classes:
AbstractOfferServiceExtensionHandler,OfferServiceExtensionManager
public interface OfferServiceExtensionHandler
extends org.broadleafcommerce.common.extension.ExtensionHandler
- Author:
- Andre Azzolini (apazzolini), bpolster
-
Method Summary
Modifier and TypeMethodDescriptionorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeaddAdditionalOffersForCode(List<Offer> offers, OfferCode offerCode) Allows module extensions to add additional offers for a given offer code.org.broadleafcommerce.common.extension.ExtensionResultStatusTypeapplyAdditionalFilters(List<Offer> offers, Order order) org.broadleafcommerce.common.extension.ExtensionResultStatusTypeapplyAdditionalRuleVariablesForItemOfferEvaluation(PromotableOrderItem orderItem, HashMap<String, Object> vars) Allows a module to append additional rule variables that may be needed for order item evaluationorg.broadleafcommerce.common.extension.ExtensionResultStatusTypeapplyItemOffer(PromotableOrder order, PromotableCandidateItemOffer itemOffer, Map<String, Object> contextMap) Modules may need to extend the applyItemOffer logicorg.broadleafcommerce.common.extension.ExtensionResultStatusTypebuildOfferCodeListForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, List<OfferCode> offerCodes) Allows module extension to add additional offer codes to the list, given the customerorg.broadleafcommerce.common.extension.ExtensionResultStatusTypecalculatePotentialSavings(PromotableCandidateItemOffer itemOffer, PromotableOrderItem item, int quantity, Map<String, Object> contextMap) Modules may extend the calculatePotentialSavings method.org.broadleafcommerce.common.extension.ExtensionResultStatusTypeAllows a module to finalize adjustments.org.broadleafcommerce.common.extension.ExtensionResultStatusTypecreateOrderItemPriceDetailAdjustment(org.broadleafcommerce.common.extension.ExtensionResultHolder<?> resultHolder, OrderItemPriceDetail itemDetail) Allows module extensions to add a create a new instance of OrderItemPriceDetailAdjustment.org.broadleafcommerce.common.extension.ExtensionResultStatusTyperemoveOfferCodeFromOrder(OfferCode offerCode, Order order) org.broadleafcommerce.common.extension.ExtensionResultStatusTypeModules may need to clear additional offer details when resetPriceDetails is called.org.broadleafcommerce.common.extension.ExtensionResultStatusTypeAllows a module to amend the data that synchronizes thePromotableOrderwith theOrderMethods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Method Details
-
applyAdditionalFilters
-
buildOfferCodeListForCustomer
org.broadleafcommerce.common.extension.ExtensionResultStatusType buildOfferCodeListForCustomer(org.broadleafcommerce.profile.core.domain.Customer customer, List<OfferCode> offerCodes) Allows module extension to add additional offer codes to the list, given the customer- Parameters:
customer-offerCodes-- Returns:
-
calculatePotentialSavings
org.broadleafcommerce.common.extension.ExtensionResultStatusType calculatePotentialSavings(PromotableCandidateItemOffer itemOffer, PromotableOrderItem item, int quantity, Map<String, Object> contextMap) Modules may extend the calculatePotentialSavings method. Once the handlers run, the contextMap will be checked for an entry with a key of "savings". If that entry returns a non-null Money, that value will be returned from the calling method.Otherwise, the map will be checked for an entry with a key of "quantity". If a non-null Integer is returned, that value will replace the quantity call in the normal call to calculatePotentialSavings.
This extension is utilized by one or more BLC enterprise modules including Subscription.
- Parameters:
itemOffer-item-quantity-contextMap-- Returns:
-
resetPriceDetails
org.broadleafcommerce.common.extension.ExtensionResultStatusType resetPriceDetails(PromotableOrderItem item) Modules may need to clear additional offer details when resetPriceDetails is called.- Parameters:
item-- Returns:
-
applyItemOffer
org.broadleafcommerce.common.extension.ExtensionResultStatusType applyItemOffer(PromotableOrder order, PromotableCandidateItemOffer itemOffer, Map<String, Object> contextMap) Modules may need to extend the applyItemOffer logicFor example, a subscription module might creates future payment adjustments.
The module add an attribute of type Boolean to the contextMap named "stopProcessing" indicating to the core offer engine that further adjustment processing is not needed.
- Parameters:
order-itemOffer-contextMap-- Returns:
-
synchronizeAdjustmentsAndPrices
org.broadleafcommerce.common.extension.ExtensionResultStatusType synchronizeAdjustmentsAndPrices(PromotableOrder order) Allows a module to amend the data that synchronizes thePromotableOrderwith theOrder- Parameters:
order-- Returns:
-
chooseSaleOrRetailAdjustments
org.broadleafcommerce.common.extension.ExtensionResultStatusType chooseSaleOrRetailAdjustments(PromotableOrder order) Allows a module to finalize adjustments.- Parameters:
order-- Returns:
-
createOrderItemPriceDetailAdjustment
org.broadleafcommerce.common.extension.ExtensionResultStatusType createOrderItemPriceDetailAdjustment(org.broadleafcommerce.common.extension.ExtensionResultHolder<?> resultHolder, OrderItemPriceDetail itemDetail) Allows module extensions to add a create a new instance of OrderItemPriceDetailAdjustment. The module should add the value to the resultHolder.getContextMap() with a key of "OrderItemPriceDetailAdjustment"- Parameters:
resultHolder-- Returns:
-
applyAdditionalRuleVariablesForItemOfferEvaluation
org.broadleafcommerce.common.extension.ExtensionResultStatusType applyAdditionalRuleVariablesForItemOfferEvaluation(PromotableOrderItem orderItem, HashMap<String, Object> vars) Allows a module to append additional rule variables that may be needed for order item evaluation- Parameters:
orderItem- - the promotable order item in considerationvars- - the rule map- Returns:
-
addAdditionalOffersForCode
org.broadleafcommerce.common.extension.ExtensionResultStatusType addAdditionalOffersForCode(List<Offer> offers, OfferCode offerCode) Allows module extensions to add additional offers for a given offer code.- Parameters:
offers-offerCode-- Returns:
-
removeOfferCodeFromOrder
-