Class CustomerSegmentOfferServiceExtensionHandler

java.lang.Object
org.broadleafcommerce.common.extension.AbstractExtensionHandler
org.broadleafcommerce.core.offer.service.AbstractOfferServiceExtensionHandler
com.broadleafcommerce.customersegment.extension.CustomerSegmentOfferServiceExtensionHandler
All Implemented Interfaces:
org.broadleafcommerce.common.extension.ExtensionHandler, org.broadleafcommerce.core.offer.service.OfferServiceExtensionHandler

@Service("blCustomerSegmentOfferServiceExtensionHandler") public class CustomerSegmentOfferServiceExtensionHandler extends org.broadleafcommerce.core.offer.service.AbstractOfferServiceExtensionHandler
This extension of the OfferService allows the system to filter offers based on the Customer Segment.
Author:
Chris Kittrell
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected org.broadleafcommerce.core.offer.service.OfferServiceExtensionManager
     

    Fields inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler

    enabled, priority
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.broadleafcommerce.common.extension.ExtensionResultStatusType
    applyAdditionalFilters(List<org.broadleafcommerce.core.offer.domain.Offer> offers, org.broadleafcommerce.core.order.domain.Order order)
    Filter out offers that do not match the customerSegment rule or customer set (if applicable).
    void
     
    protected boolean
    isCustomerInCustomerSegments(List<OfferCustomerSegmentXref> customerSegments, org.broadleafcommerce.profile.core.domain.Customer customer)
     

    Methods inherited from class org.broadleafcommerce.core.offer.service.AbstractOfferServiceExtensionHandler

    addAdditionalOffersForCode, applyAdditionalRuleVariablesForItemOfferEvaluation, applyItemOffer, buildOfferCodeListForCustomer, calculatePotentialSavings, chooseSaleOrRetailAdjustments, createOrderItemPriceDetailAdjustment, removeOfferCodeFromOrder, resetPriceDetails, synchronizeAdjustmentsAndPrices

    Methods inherited from class org.broadleafcommerce.common.extension.AbstractExtensionHandler

    getPriority, isEnabled, setEnabled, setPriority

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.broadleafcommerce.common.extension.ExtensionHandler

    getPriority, isEnabled
  • Field Details

    • extensionManager

      protected org.broadleafcommerce.core.offer.service.OfferServiceExtensionManager extensionManager
    • customerSegmentService

      protected CustomerSegmentService customerSegmentService
  • Constructor Details

    • CustomerSegmentOfferServiceExtensionHandler

      public CustomerSegmentOfferServiceExtensionHandler()
  • Method Details

    • init

      @PostConstruct public void init()
    • applyAdditionalFilters

      public org.broadleafcommerce.common.extension.ExtensionResultStatusType applyAdditionalFilters(List<org.broadleafcommerce.core.offer.domain.Offer> offers, org.broadleafcommerce.core.order.domain.Order order)
      Filter out offers that do not match the customerSegment rule or customer set (if applicable).
      Specified by:
      applyAdditionalFilters in interface org.broadleafcommerce.core.offer.service.OfferServiceExtensionHandler
      Overrides:
      applyAdditionalFilters in class org.broadleafcommerce.core.offer.service.AbstractOfferServiceExtensionHandler
    • isCustomerInCustomerSegments

      protected boolean isCustomerInCustomerSegments(List<OfferCustomerSegmentXref> customerSegments, org.broadleafcommerce.profile.core.domain.Customer customer)