Interface Offer
- All Superinterfaces:
MultiTenantCloneable<Offer>,Serializable,Status
- All Known Implementing Classes:
OfferImpl
-
Method Summary
Modifier and TypeMethodDescriptionThis indicates how an Offer should be fulfilled to the customer, defaulting to order time discount.booleanReturns whether or not this offer should apply to anOrderItems child order itemsgetId()Returns the maximum number of times that this offer can be used by the same customer.intReturns the maximum number of times that this offer can be used in the current order.Enum that allows implementations to vary how customer max uses will be interpreted.Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated bygetMaxUsesPerCustomer().getName()Returns the offer codes that can be used to retrieve this Offer.intIndicates the amount of items that must be purchased for this offer to be considered for this order.getType()getValue()booleanReturns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism).booleanReturns false if this offer is not combinable with other offers of the same type.booleanFuture credit means that the associated adjustment will be discounted at a later time to the customer via a credit.booleanWhether or not this offer has limited use in an order.booleanWhether or not this offer has limited use in an order.booleanIndicates that there is no limit to how many times a customer can use this offer.booleanIndicates that there is no limit to how many times this offer can be applied to the order.voidsetAdjustmentType(OfferAdjustmentType adjustmentType) This indicates how an Offer should be fulfilled to the customer, defaulting to order time discount.voidsetApplyDiscountToSalePrice(boolean applyToSalePrice) voidsetApplyToChildItems(boolean applyToChildItems) Sets whether or not this offer should apply to anOrderItems child order itemsvoidsetAutomaticallyAdded(boolean automaticallyAdded) Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).voidsetCombinableWithOtherOffers(boolean combinableWithOtherOffers) voidsetDescription(String description) voidvoidsetEndDate(Date endDate) voidvoidsetMarketingMessage(String marketingMessage) voidsetMaxUsesPerCustomer(Long maxUses) Sets the maximum number of times that this offer can be used by the same customer.voidsetMaxUsesPerOrder(int maxUsesPerOrder) Sets the maximum number of times that this offer can be used in the current order.voidsetMaxUsesStrategyType(CustomerMaxUsesStrategyType strategyType) Sets the strategy for determining customer max uses.voidsetMinimumDaysPerUsage(Long minimumDaysPerUsage) Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated bygetMaxUsesPerCustomer().voidvoidsetOfferCodes(List<OfferCode> offerCodes) Sets the offer codes that can be used to retrieve this Offer.voidsetOfferItemQualifierRuleType(OfferItemRestrictionRuleType restrictionRuleType) voidsetOfferItemTargetRuleType(OfferItemRestrictionRuleType restrictionRuleType) voidsetOfferMatchRulesXref(Map<String, OfferOfferRuleXref> offerMatchRulesXref) voidsetOfferPriceData(List<OfferPriceData> offerPriceData) voidsetOrderMinSubTotal(Money orderMinSubTotal) voidsetPriority(Integer priority) voidsetQualifyingItemCriteriaXref(Set<OfferQualifyingCriteriaXref> qualifyingItemCriteriaXref) voidsetQualifyingItemSubTotal(Money qualifyingItemSubtotal) voidsetRequiresRelatedTargetAndQualifiers(Boolean requiresRelatedTargetAndQualifiers) voidsetStartDate(Date startDate) voidsetTargetItemCriteriaXref(Set<OfferTargetCriteriaXref> targetItemCriteriaXref) voidsetTargetMinSubTotal(Money targetMinSubTotal) voidsetTargetSystem(String targetSystem) voidsetTotalitarianOffer(Boolean totalitarianOffer) voidvoidsetUseListForDiscounts(Boolean useListForDiscounts) voidsetValue(BigDecimal value) Methods inherited from interface org.broadleafcommerce.common.copy.MultiTenantCloneable
createOrRetrieveCopyInstanceMethods inherited from interface org.broadleafcommerce.common.persistence.Status
getArchived, isActive, setArchived
-
Method Details
-
getId
Long getId() -
setId
-
getName
String getName() -
setName
-
getDescription
String getDescription() -
setDescription
-
getType
OfferType getType() -
setType
-
getDiscountType
OfferDiscountType getDiscountType() -
setDiscountType
-
getValue
BigDecimal getValue() -
setValue
-
getPriority
int getPriority() -
setPriority
-
getStartDate
Date getStartDate() -
setStartDate
-
getEndDate
Date getEndDate() -
setEndDate
-
getTargetSystem
String getTargetSystem() -
setTargetSystem
-
getApplyDiscountToSalePrice
boolean getApplyDiscountToSalePrice() -
setApplyDiscountToSalePrice
void setApplyDiscountToSalePrice(boolean applyToSalePrice) -
getOfferItemQualifierRuleType
OfferItemRestrictionRuleType getOfferItemQualifierRuleType() -
setOfferItemQualifierRuleType
-
getOfferItemTargetRuleType
OfferItemRestrictionRuleType getOfferItemTargetRuleType() -
setOfferItemTargetRuleType
-
getApplyToChildItems
Boolean getApplyToChildItems()Returns whether or not this offer should apply to anOrderItems child order items- Returns:
- applyToChildItems
-
setApplyToChildItems
void setApplyToChildItems(boolean applyToChildItems) Sets whether or not this offer should apply to anOrderItems child order items- Parameters:
applyToChildItems-
-
isCombinableWithOtherOffers
boolean isCombinableWithOtherOffers()Returns false if this offer is not combinable with other offers of the same type. For example, if this is an Item offer it could be combined with other Order or FG offers but it cannot be combined with other Item offers.- Returns:
-
setCombinableWithOtherOffers
void setCombinableWithOtherOffers(boolean combinableWithOtherOffers) -
isAutomaticallyAdded
boolean isAutomaticallyAdded()Returns true if the offer system should automatically add this offer for consideration (versus requiring a code or other delivery mechanism). This does not guarantee that the offer will qualify. All rules associated with this offer must still pass. A true value here just means that the offer will be considered.Returns null if false
- Returns:
-
setAutomaticallyAdded
void setAutomaticallyAdded(boolean automaticallyAdded) Sets whether or not this offer should be automatically considered for consideration (versus requiring a code or other delivery mechanism).- See Also:
-
getMaxUsesPerCustomer
Long getMaxUsesPerCustomer()Returns the maximum number of times that this offer can be used by the same customer. This field tracks the number of times the offer can be used and not how many times it is applied.0 or null indicates unlimited usage per customer.
- Returns:
-
setMaxUsesPerCustomer
Sets the maximum number of times that this offer can be used by the same customer. Intended as a transient field that gets derived from the other persisted max uses fields including maxUsesPerOrder and maxUsesPerCustomer.0 or null indicates unlimited usage.
- Parameters:
maxUses-
-
getMaxUsesStrategyType
CustomerMaxUsesStrategyType getMaxUsesStrategyType()Enum that allows implementations to vary how customer max uses will be interpreted. If null, the strategy will beCustomerMaxUsesStrategyType.CUSTOMER.- Returns:
-
setMaxUsesStrategyType
Sets the strategy for determining customer max uses.- Parameters:
strategyType-- See Also:
-
getMinimumDaysPerUsage
Long getMinimumDaysPerUsage()Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated bygetMaxUsesPerCustomer().0 or null indicates that the offer will never reset usages.
- Returns:
-
setMinimumDaysPerUsage
Sets the minimum number of days that this offer can be used by the same customer before resetting the number of uses dictated bygetMaxUsesPerCustomer().0 or null indicates that the offer will never reset usages.
- Parameters:
minimumDaysPerUsage-
-
isUnlimitedUsePerCustomer
boolean isUnlimitedUsePerCustomer()Indicates that there is no limit to how many times a customer can use this offer. By default this is true ifgetMaxUsesPerCustomer()== 0 -
isLimitedUsePerCustomer
boolean isLimitedUsePerCustomer()Whether or not this offer has limited use in an order. By default this is true ifgetMaxUsesPerCustomer()> 0 -
getMaxUsesPerOrder
int getMaxUsesPerOrder()Returns the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
-
setMaxUsesPerOrder
void setMaxUsesPerOrder(int maxUsesPerOrder) Sets the maximum number of times that this offer can be used in the current order.0 indicates unlimited usage.
- Parameters:
maxUsesPerOrder-
-
isUnlimitedUsePerOrder
boolean isUnlimitedUsePerOrder()Indicates that there is no limit to how many times this offer can be applied to the order. By default this is true ifgetMaxUsesPerOrder()== 0 -
isLimitedUsePerOrder
boolean isLimitedUsePerOrder()Whether or not this offer has limited use in an order. By default this is true ifgetMaxUsesPerOrder()> 0 -
getQualifyingItemCriteriaXref
Set<OfferQualifyingCriteriaXref> getQualifyingItemCriteriaXref() -
setQualifyingItemCriteriaXref
-
getTargetItemCriteriaXref
Set<OfferTargetCriteriaXref> getTargetItemCriteriaXref() -
setTargetItemCriteriaXref
-
isTotalitarianOffer
Boolean isTotalitarianOffer() -
setTotalitarianOffer
-
getOfferMatchRulesXref
Map<String,OfferOfferRuleXref> getOfferMatchRulesXref() -
setOfferMatchRulesXref
-
getUseListForDiscounts
Boolean getUseListForDiscounts() -
setUseListForDiscounts
-
getOfferPriceData
List<OfferPriceData> getOfferPriceData() -
setOfferPriceData
-
getQualifyingItemSubTotal
Money getQualifyingItemSubTotal()Indicates the amount of items that must be purchased for this offer to be considered for this order.The system will find all qualifying items for the given offer and sum their prices before any discounts are applied to make the determination.
If the sum of the qualifying items is not greater than this value the offer is not considered by the offer processing algorithm.
- Returns:
-
setQualifyingItemSubTotal
-
getOrderMinSubTotal
Money getOrderMinSubTotal() -
setOrderMinSubTotal
-
getMarketingMessage
String getMarketingMessage() -
setMarketingMessage
-
getTargetMinSubTotal
Money getTargetMinSubTotal() -
setTargetMinSubTotal
-
getOfferCodes
Returns the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered (meaningisAutomaticallyAdded()is false} -
setOfferCodes
Sets the offer codes that can be used to retrieve this Offer. These codes would be used in situations where this Offer is not automatically considered (meaningisAutomaticallyAdded()is false} -
getRequiresRelatedTargetAndQualifiers
Boolean getRequiresRelatedTargetAndQualifiers() -
setRequiresRelatedTargetAndQualifiers
-
getAdjustmentType
OfferAdjustmentType getAdjustmentType()This indicates how an Offer should be fulfilled to the customer, defaulting to order time discount. Currently, this enumeration can be ORDER_DISCOUNT or FUTURE_CREDIT. "Future credit" means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.Out-of-box, this field is disabled from admin and must be manually enabled to view, since it is not a typical requirement to most implementations. To enable, add the following to AdminConfig.java:
- Returns:
-
setAdjustmentType
This indicates how an Offer should be fulfilled to the customer, defaulting to order time discount. Currently, this enumeration can be ORDER_DISCOUNT or FUTURE_CREDIT. "Future credit" means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.Out-of-box, this field is disabled from admin and must be manually enabled to view, since it is not a typical requirement to most implementations. To enable, add the following to AdminConfig.java:
- Parameters:
adjustmentType-
-
isFutureCredit
boolean isFutureCredit()Future credit means that the associated adjustment will be discounted at a later time to the customer via a credit. It is up to the implementor to decide how to achieve this. The adjustment entities have a new "isFutureCredit" field used to determine if an adjustment originated from an offer marked as FUTURE_CREDIT. Order, OrderItem and FulfillmentGroup have new accessor methods for retrieving the future credit values when they are needed to be fulfilled.See
getAdjustmentType()for more info- Returns:
-