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 Details

    • applyAdditionalFilters

      org.broadleafcommerce.common.extension.ExtensionResultStatusType applyAdditionalFilters(List<Offer> offers, Order order)
    • 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 logic

      For 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 the PromotableOrder with the Order
      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 consideration
      vars - - 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

      org.broadleafcommerce.common.extension.ExtensionResultStatusType removeOfferCodeFromOrder(OfferCode offerCode, Order order)