Class DefaultPromotionEngineService
java.lang.Object
de.hybris.platform.promotionengineservices.promotionengine.impl.DefaultPromotionEngineService
- All Implemented Interfaces:
PromotionEngineService,PromotionsService
public class DefaultPromotionEngineService
extends Object
implements PromotionEngineService, PromotionsService
Default implementation of Promotion Engine Service that uses Rule Engine Service to evaluate promotions.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidcleanupCart(CartModel cart) Delete the the stored promotion results for a Cart.protected AbstractRuleEngineContextModeldetermines the rule engine context to be used for the given order.protected AbstractRuleEngineContextModeldetermineRuleEngineContext(ProductModel product) determines the rule engine context to be used for the given product.evaluate(AbstractOrderModel order, Collection<PromotionGroupModel> promotionGroups) evaluate the promotions for the given cart or order and for now.evaluate(AbstractOrderModel order, Collection<PromotionGroupModel> promotionGroups, Date date) evaluate the promotions for the given cart or order and for the date.protected <T> TfindImmutablePromotionByUniqueKey(String immutableKeyHash, Predicate<T> immutableKeyPredicate) List<? extends AbstractPromotionModel>getAbstractProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Get the ordered list ofAbstractPromotionModelinstances that are related to theProductModelspecified.List<? extends AbstractPromotionModel>getAbstractProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, Date date) Get the ordered list ofAbstractPromotionModelinstances that are related to theProductModelspecified.protected CalculationServiceprotected CatalogVersionServicegetCategoryCodesForProduct(ProductModel product) protected CategoryServiceprotected RuleEngineServiceprotected ConfigurationServiceprotected StringgetDataUniqueKey(AbstractPromotionModel sourcePromotion) Lookup the default promotion group created by the promotions extension.protected EngineRuleDaoprotected FactContextFactoryprotected FlexibleSearchServiceprotected ModelServicegetOrderPromotions(Collection<PromotionGroupModel> promotionGroups) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product, Date date) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, Date date) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, Date date) Get the ordered list ofOrderPromotioninstances.getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, Date date) Get the ordered list ofOrderPromotioninstances.getProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Get the ordered list ofProductPromotioninstances that are related to theProductModelspecified.getProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, Date date) Get the ordered list ofProductPromotioninstances that are related to theProductModelspecified.protected ProductUtilsprotected PromotionDaogetPromotionDescription(AbstractPromotionModel promotion) Get the description of given promotion.getPromotionGroup(String identifier) Lookup a promotion group with the given identifier.Get the promotion results for the specified order.getPromotionResults(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, Date date) Get the promotion results for the specified order.protected ArrayList<RuleBasedPromotionModel>getPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) protected List<RuleBasedPromotionModel>getPromotionsForProduct(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Get all promotions, sorted by priority, that could be applied for the given product and promotion groups.protected PromotionSourceRuleDaogetRestrictions(AbstractPromotionModel promotion) Get the collection ofAbstractPromotionRestrictionModelinstances.protected RuleActionServiceprotected RuleActionStrategygetRuleActionStrategy(String strategyId) returns theRuleActionStrategydefined in thestrategiesattribute of this service by looking up it's bean id.protected RuleBasedPromotionsContextValidatorprotected RuleEngineContextDaoprotected RuleEngineContextFinderStrategyprotected SessionServiceprotected List<RuleActionStrategy>protected TimeServiceprotected booleanisApplicable(ProductModel product, RuleBasedPromotionModel promotion) protected RuleEvaluationContextprepareContext(FactContext factContext, AbstractRuleEngineContextModel ruleEngineContext) Sets up the rule evaluation context using the provided factContext with facts and rao providers and sets the given ruleEngineContext.provideRAOs(FactContext factContext) Converts the givensourceobject into an RAO using the configuredraoProviders.protected booleanvoidsetActionUtils(ActionUtils actionUtils) voidsetCalculationService(CalculationService calculationService) voidsetCatalogVersionService(CatalogVersionService catalogVersionService) voidsetCategoryService(CategoryService categoryService) voidsetCommerceRuleEngineService(RuleEngineService ruleEngineService) voidsetConfigurationService(ConfigurationService configurationService) voidsetDefaultPromotionsService(DefaultPromotionsService defaultPromotionsService) voidsetEngineRuleDao(EngineRuleDao engineRuleDao) voidsetFactContextFactory(FactContextFactory factContextFactory) voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService) voidsetModelService(ModelService modelService) voidsetProductUtils(ProductUtils productUtils) voidsetPromotionDao(PromotionDao promotionDao) voidsetPromotionSourceRuleDao(PromotionSourceRuleDao promotionSourceRuleDao) voidsetRuleActionService(RuleActionService ruleActionService) voidsetRuleBasedPromotionsContextValidator(RuleBasedPromotionsContextValidator ruleBasedPromotionsContextValidator) voidsetRuleEngineContextDao(RuleEngineContextDao ruleEngineContextDao) voidsetRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy) voidsetRuleEngineContextForCatalogVersionsFinderStrategy(RuleEngineContextForCatalogVersionsFinderStrategy ruleEngineContextForCatalogVersionsFinderStrategy) voidsetSessionService(SessionService sessionService) voidsetStrategies(List<RuleActionStrategy> strategies) voidsetTimeService(TimeService timeService) voidtransferPromotionsToOrder(AbstractOrderModel source, OrderModel target, boolean onlyTransferAppliedPromotions) Transfer the promotions applied to a cart to a new order.protected voidupdatePromotions(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order) Update the promotions on the specifiedAbstractOrderobject.updatePromotions(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, Date date) Update the promotions on the specifiedAbstractOrderModelobject.protected PromotionOrderResultsupdatePromotionsNotThreadSafe(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order) protected PromotionOrderResultsupdatePromotionsNotThreadSafe(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, Date date)
-
Constructor Details
-
DefaultPromotionEngineService
public DefaultPromotionEngineService()
-
-
Method Details
-
evaluate
public RuleEvaluationResult evaluate(AbstractOrderModel order, Collection<PromotionGroupModel> promotionGroups) Description copied from interface:PromotionEngineServiceevaluate the promotions for the given cart or order and for now. This does not apply the result to the cart/order.- Specified by:
evaluatein interfacePromotionEngineService- Parameters:
order- the cart or order to evaluatepromotionGroups- collection of promotion groups to apply promotions for- Returns:
- the result of the evaluation
-
evaluate
public RuleEvaluationResult evaluate(AbstractOrderModel order, Collection<PromotionGroupModel> promotionGroups, Date date) Description copied from interface:PromotionEngineServiceevaluate the promotions for the given cart or order and for the date. This does not apply the result to the cart/order.- Specified by:
evaluatein interfacePromotionEngineService- Parameters:
order- the cart or order to evaluatepromotionGroups- collection of promotion groups to apply promotions fordate- the moment of evaluation- Returns:
- the result of the evaluation
-
prepareContext
protected RuleEvaluationContext prepareContext(FactContext factContext, AbstractRuleEngineContextModel ruleEngineContext) Sets up the rule evaluation context using the provided factContext with facts and rao providers and sets the given ruleEngineContext.- Parameters:
factContext- FactContext to use for the evaluationruleEngineContext- the rule engine context to be used during rule evaluation- Returns:
- the rule evaluation context
-
determineRuleEngineContext
determines the rule engine context to be used for the given order. This method usesRuleEngineContextFinderStrategy.findRuleEngineContext(AbstractOrderModel, RuleType)to determine the rule engine context to be used.- Parameters:
order- the order to be used- Returns:
- the rule engine context to be used
-
determineRuleEngineContext
determines the rule engine context to be used for the given product. This method usesRuleEngineContextFinderStrategy.findRuleEngineContext(ProductModel, RuleType)to determine the rule engine context to be used.- Parameters:
product- the product to be used- Returns:
- the rule engine context to be used
-
provideRAOs
Converts the givensourceobject into an RAO using the configuredraoProviders.- Parameters:
factContext- FactContext containing rao providers- Throws:
RuntimeException- if no raoProvider is registered for the given source object
-
getAbstractProductPromotions
public List<? extends AbstractPromotionModel> getAbstractProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Description copied from interface:PromotionsServiceGet the ordered list ofAbstractPromotionModelinstances that are related to theProductModelspecified.- Specified by:
getAbstractProductPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product that the promotions are related to- Returns:
- The list of
AbstractPromotionModelrelated to theProductModelspecified
-
getAbstractProductPromotions
public List<? extends AbstractPromotionModel> getAbstractProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofAbstractPromotionModelinstances that are related to theProductModelspecified.- Specified by:
getAbstractProductPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product that the promotions are related toevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.date- The date to check for promotions, typically the current date- Returns:
- The list of
AbstractPromotionModelrelated to theProductModelspecified
-
getProductPromotions
public List<ProductPromotionModel> getProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Description copied from interface:PromotionsServiceGet the ordered list ofProductPromotioninstances that are related to theProductModelspecified.- Specified by:
getProductPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product that the promotions are related to- Returns:
- The list of
ProductPromotionrelated to theProductModelspecified
-
getProductPromotions
public List<ProductPromotionModel> getProductPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofProductPromotioninstances that are related to theProductModelspecified.- Specified by:
getProductPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product that the promotions are related toevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.date- The date to check for promotions, typically the current date- Returns:
- The list of
ProductPromotionrelated to theProductModelspecified
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluate- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluatedate- The date to check for promotions, typically the current date- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product to pass to restrictions- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateproduct- The product to pass to restrictionsdate- The date to check for promotions, typically the current date- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.date- The date to check for promotions, typically the current date- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.product- The product to pass to restrictions if evaluateRestrictions is true- Returns:
- The list of
OrderPromotion
-
getOrderPromotions
public List<OrderPromotionModel> getOrderPromotions(Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product, Date date) Description copied from interface:PromotionsServiceGet the ordered list ofOrderPromotioninstances.- Specified by:
getOrderPromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateevaluateRestrictions- Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the restrictions.product- The product to pass to restrictions if evaluateRestrictions is truedate- The date to check for promotions, typically the current date- Returns:
- The list of
OrderPromotion
-
updatePromotions
public PromotionOrderResults updatePromotions(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order) Description copied from interface:PromotionsServiceUpdate the promotions on the specifiedAbstractOrderobject. This method will automatically apply all possible product promotional updates to the cart, but not apply order level promotions. Any previously applied order level promotions will remain applied. Promotions are evaluated at the current system time. The promotion results are stored in the database and the samePromotionOrderResultscan be obtained later by callingPromotionsService.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel).- Specified by:
updatePromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateorder- The order object to update with the results of the promotions- Returns:
- The promotion results
-
updatePromotionsNotThreadSafe
protected PromotionOrderResults updatePromotionsNotThreadSafe(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order) -
updatePromotionsNotThreadSafe
protected PromotionOrderResults updatePromotionsNotThreadSafe(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, Date date) -
updatePromotions
public PromotionOrderResults updatePromotions(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, Date date) Description copied from interface:PromotionsServiceUpdate the promotions on the specifiedAbstractOrderModelobject. The resulting promotions can be retrieved later by callingPromotionsService.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel). The order must be calculated before calling this method.PromotionsService.updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel)must be called after callingAbstractOrder.recalculate()on theAbstractOrderModel. Where thePromotionsManager.AutoApplyModeis set toPromotionsManager.AutoApplyMode.KEEP_APPLIEDthe state of any previously appliedPromotionResultis recorded and if it is still in the fired state (PromotionResult.isApplied()) after reevaluating the promotions it will be automatically reapplied. The promotion results are stored in the database and the samePromotionOrderResultscan be obtained later by callingPromotionsService.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel). After this method is called, please call getModelService().refresh(order) or getModelService().save(order).- Specified by:
updatePromotionsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateorder- The AbstractOrder object to update the promotions forevaluateRestrictions- If true any promotion restrictions will be observed, if false all promotion restrictions are ignoredproductPromotionMode- The auto apply mode. This determines whether this method applies any product promotional changes to line items or discounts to the overall amountorderPromotionMode- The auto apply mode. This determines whether this method applies any order promotional changes to line items or discounts to the overall amountdate- The effective date for the promotions to check. Use this to to see the effects of promotions in the past or future.- Returns:
- The promotion results
-
getPromotionResults
Description copied from interface:PromotionsServiceGet the promotion results for the specified order. These are the promotion results stored in the database for the specified order as generated by the last call toPromotionsService.updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel)for the same order. If any of the promotion results are invalid then they will be ignored.- Specified by:
getPromotionResultsin interfacePromotionsService- Parameters:
order- The order to get the promotion results for- Returns:
- The promotion results
-
getPromotionResults
public PromotionOrderResults getPromotionResults(Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, Date date) Description copied from interface:PromotionsServiceGet the promotion results for the specified order. These are the promotion results stored in the database for the specified order as generated by the last call toPromotionsService.updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel)for the same order. If any of the promotion results are invalid then this method will recalculate the promotions by callingPromotionsService.updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel).- Specified by:
getPromotionResultsin interfacePromotionsService- Parameters:
promotionGroups- The promotion groups to evaluateorder- The AbstractOrder object to get the promotions forevaluateRestrictions- If true any promotion restrictions will be observed, if false all promotion restrictions are ignoredproductPromotionMode- The auto apply mode. This determines whether this method applies any product promotional changes to line items or discounts to the overall amountorderPromotionMode- The auto apply mode. This determines whether this method applies any order promotional changes to line items or discounts to the overall amountdate- The effective date for the promotions to check. Use this to to see the effects of promotions in the past or future.- Returns:
- The promotion results
-
cleanupCart
Description copied from interface:PromotionsServiceDelete the the stored promotion results for a Cart.- Specified by:
cleanupCartin interfacePromotionsService- Parameters:
cart- TheCartto delete the results for
-
cleanupAbstractOrder
-
undoPromotionAction
-
transferPromotionsToOrder
public void transferPromotionsToOrder(AbstractOrderModel source, OrderModel target, boolean onlyTransferAppliedPromotions) Description copied from interface:PromotionsServiceTransfer the promotions applied to a cart to a new order. This is used when an order is created from a cart.- Specified by:
transferPromotionsToOrderin interfacePromotionsService- Parameters:
source- The cart that has promotionstarget- The order that promotions should be applied toonlyTransferAppliedPromotions- Flag to indicate that only applied promotions should be transfered. If false all promotion results will be transfered
-
getDataUniqueKey
-
findImmutablePromotionByUniqueKey
-
getDefaultPromotionGroup
Description copied from interface:PromotionsServiceLookup the default promotion group created by the promotions extension.- Specified by:
getDefaultPromotionGroupin interfacePromotionsService- Returns:
- the default promotion group
-
getPromotionGroup
Description copied from interface:PromotionsServiceLookup a promotion group with the given identifier.- Specified by:
getPromotionGroupin interfacePromotionsService- Parameters:
identifier- identifier of the promotion group to look for- Returns:
- the promotion group or null if no group with the given identifier is found
-
getRestrictions
public Collection<AbstractPromotionRestrictionModel> getRestrictions(AbstractPromotionModel promotion) Description copied from interface:PromotionsServiceGet the collection ofAbstractPromotionRestrictionModelinstances.- Specified by:
getRestrictionsin interfacePromotionsService- Parameters:
promotion- the promotion which restrictions should be returned- Returns:
- A collection of
AbstractPromotionRestrictionModelinstances attached to this promotion.
-
getPromotionDescription
Description copied from interface:PromotionsServiceGet the description of given promotion.- Specified by:
getPromotionDescriptionin interfacePromotionsService- Parameters:
promotion- the promotion to get the description for- Returns:
- String representing promotion description
-
getRuleActionStrategy
returns theRuleActionStrategydefined in thestrategiesattribute of this service by looking up it's bean id.- Parameters:
strategyId- the bean id of the RuleActionStrategy to look up- Returns:
- the found bean id
-
getStrategies
-
setStrategies
-
recalculateCart
-
getEngineRuleDao
-
setEngineRuleDao
-
getFlexibleSearchService
-
setFlexibleSearchService
-
getPromotionDao
-
setPromotionDao
-
getFactContextFactory
-
setFactContextFactory
-
getDefaultPromotionsService
-
setDefaultPromotionsService
-
getCommerceRuleEngineService
-
setCommerceRuleEngineService
-
getCalculationService
-
setCalculationService
-
getRuleActionService
-
setRuleActionService
-
getRuleEngineContextDao
-
setRuleEngineContextDao
-
getPromotionsForProduct
protected List<RuleBasedPromotionModel> getPromotionsForProduct(Collection<PromotionGroupModel> promotionGroups, ProductModel product) Get all promotions, sorted by priority, that could be applied for the given product and promotion groups. If property promotionengineservices.getpromotionsforproduct.disable is set to true, returns an empty list.- Parameters:
promotionGroups- collection of promotion groups to apply promotions forproduct- product to get promotions for- Returns:
- List of
RuleBasedPromotionModelwhich could be applied to the given product and are sorted by priority or empty list if promotionengineservices.getpromotionsforproduct.disable is set to true
-
getPromotions
protected ArrayList<RuleBasedPromotionModel> getPromotions(Collection<PromotionGroupModel> promotionGroups, ProductModel product) -
isApplicable
-
getCategoryCodesForProduct
-
getPromotionSourceRuleDao
-
setPromotionSourceRuleDao
-
getCategoryService
-
setCategoryService
-
getConfigurationService
-
setConfigurationService
-
getCatalogVersionService
-
setCatalogVersionService
-
getRuleEngineContextForCatalogVersionsFinderStrategy
protected RuleEngineContextForCatalogVersionsFinderStrategy getRuleEngineContextForCatalogVersionsFinderStrategy() -
setRuleEngineContextForCatalogVersionsFinderStrategy
public void setRuleEngineContextForCatalogVersionsFinderStrategy(RuleEngineContextForCatalogVersionsFinderStrategy ruleEngineContextForCatalogVersionsFinderStrategy) -
getRuleEngineContextFinderStrategy
-
setRuleEngineContextFinderStrategy
public void setRuleEngineContextFinderStrategy(RuleEngineContextFinderStrategy ruleEngineContextFinderStrategy) -
getRuleBasedPromotionsContextValidator
-
setRuleBasedPromotionsContextValidator
public void setRuleBasedPromotionsContextValidator(RuleBasedPromotionsContextValidator ruleBasedPromotionsContextValidator) -
getSessionService
-
setSessionService
-
getModelService
-
setModelService
-
getTimeService
-
setTimeService
-
getProductUtils
-
setProductUtils
-
getActionUtils
-
setActionUtils
-