Interface OfferServiceExtensionHandler
- All Superinterfaces:
ExtensionHandler
- All Known Implementing Classes:
AbstractOfferServiceExtensionHandler,OfferServiceExtensionManager
- Author:
- Andre Azzolini (apazzolini), bpolster
-
Method Summary
Modifier and TypeMethodDescriptionaddAdditionalOffersForCode(List<Offer> offers, OfferCode offerCode) Allows module extensions to add additional offers for a given offer code.applyAdditionalFilters(List<Offer> offers, Order order) applyAdditionalRuleVariablesForItemOfferEvaluation(PromotableOrderItem orderItem, HashMap<String, Object> vars) Allows a module to append additional rule variables that may be needed for order item evaluationapplyItemOffer(PromotableOrder order, PromotableCandidateItemOffer itemOffer, Map<String, Object> contextMap) Modules may need to extend the applyItemOffer logicbuildOfferCodeListForCustomer(Customer customer, List<OfferCode> offerCodes) Allows module extension to add additional offer codes to the list, given the customercalculatePotentialSavings(PromotableCandidateItemOffer itemOffer, PromotableOrderItem item, int quantity, Map<String, Object> contextMap) Modules may extend the calculatePotentialSavings method.Allows a module to finalize adjustments.createOrderItemPriceDetailAdjustment(ExtensionResultHolder<?> resultHolder, OrderItemPriceDetail itemDetail) Allows module extensions to add a create a new instance of OrderItemPriceDetailAdjustment.removeOfferCodeFromOrder(OfferCode offerCode, Order order) Modules may need to clear additional offer details when resetPriceDetails is called.Allows a module to amend the data that synchronizes thePromotableOrderwith theOrderMethods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler
getPriority, isEnabled
-
Method Details
-
applyAdditionalFilters
-
buildOfferCodeListForCustomer
ExtensionResultStatusType buildOfferCodeListForCustomer(Customer customer, List<OfferCode> offerCodes) Allows module extension to add additional offer codes to the list, given the customer- Parameters:
customer-offerCodes-- Returns:
-
calculatePotentialSavings
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
Modules may need to clear additional offer details when resetPriceDetails is called.- Parameters:
item-- Returns:
-
applyItemOffer
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
Allows a module to amend the data that synchronizes thePromotableOrderwith theOrder- Parameters:
order-- Returns:
-
chooseSaleOrRetailAdjustments
Allows a module to finalize adjustments.- Parameters:
order-- Returns:
-
createOrderItemPriceDetailAdjustment
ExtensionResultStatusType createOrderItemPriceDetailAdjustment(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
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
Allows module extensions to add additional offers for a given offer code.- Parameters:
offers-offerCode-- Returns:
-
removeOfferCodeFromOrder
-