public class DefaultSapPromotionEngineService extends DefaultPromotionEngineService
| Constructor and Description |
|---|
DefaultSapPromotionEngineService() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupCart(CartModel cart)
Delete the the stored promotion results for a Cart.
|
RuleEvaluationResult |
evaluate(ProductModel product,
java.util.Collection<PromotionGroupModel> promotionGroups)
Evaluates promotion against a product taking into context which is set by promotions group
|
java.util.List<? extends AbstractPromotionModel> |
getAbstractProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product,
boolean evaluateRestrictions,
java.util.Date date)
Get the ordered list of
AbstractPromotionModel instances that are related to the ProductModel
specified. |
PromotionOrderResults |
getPromotionResults(AbstractOrderModel order)
Get the promotion results for the specified order.
|
PromotionOrderResults |
getPromotionResults(java.util.Collection<PromotionGroupModel> promotionGroups,
AbstractOrderModel order,
boolean evaluateRestrictions,
PromotionsManager.AutoApplyMode productPromotionMode,
PromotionsManager.AutoApplyMode orderPromotionMode,
java.util.Date date)
Get the promotion results for the specified order.
|
protected SapPricingEnablementService |
getSapPricingEnablementService() |
void |
setSapPricingEnablementService(SapPricingEnablementService sapPricingEnablementService) |
void |
transferPromotionsToOrder(AbstractOrderModel source,
OrderModel target,
boolean onlyTransferAppliedPromotions)
Transfer the promotions applied to a cart to a new order.
|
PromotionOrderResults |
updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
AbstractOrderModel order)
Update the promotions on the specified
AbstractOrder object. |
PromotionOrderResults |
updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
AbstractOrderModel order,
boolean evaluateRestrictions,
PromotionsManager.AutoApplyMode productPromotionMode,
PromotionsManager.AutoApplyMode orderPromotionMode,
java.util.Date date)
Update the promotions on the specified
AbstractOrderModel object. |
cleanupAbstractOrder, determineRuleEngineContext, determineRuleEngineContext, evaluate, evaluate, findImmutablePromotionByUniqueKey, getAbstractProductPromotions, getCalculationService, getCatalogVersionService, getCategoryCodesForProduct, getCategoryService, getCommerceRuleEngineService, getConfigurationService, getDataUniqueKey, getDefaultPromotionGroup, getDefaultPromotionsService, getEngineRuleDao, getFactContextFactory, getFlexibleSearchService, getModelService, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getOrderPromotions, getProductPromotions, getProductPromotions, getProductUtils, getPromotionDao, getPromotionDescription, getPromotionGroup, getPromotions, getPromotionsForProduct, getPromotionSourceRuleDao, getRestrictions, getRuleActionService, getRuleActionStrategy, getRuleBasedPromotionsContextValidator, getRuleEngineContextDao, getRuleEngineContextFinderStrategy, getRuleEngineContextForCatalogVersionsFinderStrategy, getSessionService, getStrategies, getTimeService, isApplicable, prepareContext, provideRAOs, recalculateCart, setCalculationService, setCatalogVersionService, setCategoryService, setCommerceRuleEngineService, setConfigurationService, setDefaultPromotionsService, setEngineRuleDao, setFactContextFactory, setFlexibleSearchService, setModelService, setProductUtils, setPromotionDao, setPromotionSourceRuleDao, setRuleActionService, setRuleBasedPromotionsContextValidator, setRuleEngineContextDao, setRuleEngineContextFinderStrategy, setRuleEngineContextForCatalogVersionsFinderStrategy, setSessionService, setStrategies, setTimeService, undoPromotionAction, updatePromotionsNotThreadSafe, updatePromotionsNotThreadSafepublic RuleEvaluationResult evaluate(ProductModel product, java.util.Collection<PromotionGroupModel> promotionGroups)
PromotionEngineServiceevaluate in interface PromotionEngineServiceevaluate in class DefaultPromotionEngineServiceproduct - to evaluate promotions forpromotionGroups - collection of promotion groups to apply promotions forpublic java.util.List<? extends AbstractPromotionModel> getAbstractProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, java.util.Date date)
PromotionsServiceAbstractPromotionModel instances that are related to the ProductModel
specified.getAbstractProductPromotions in interface PromotionsServicegetAbstractProductPromotions in class DefaultPromotionEngineServicepromotionGroups - 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 dateAbstractPromotionModel related to the ProductModel specifiedpublic PromotionOrderResults updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order)
PromotionsServiceAbstractOrder object.
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 same PromotionOrderResults can be obtained later
by calling PromotionsService.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel).updatePromotions in interface PromotionsServiceupdatePromotions in class DefaultPromotionEngineServicepromotionGroups - The promotion groups to evaluateorder - The order object to update with the results of the promotionspublic PromotionOrderResults updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
PromotionsServiceAbstractOrderModel object.
The resulting promotions can be retrieved later by calling PromotionsService.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 calling
AbstractOrder.recalculate() on the AbstractOrderModel. Where the PromotionsManager.AutoApplyMode is set to
PromotionsManager.AutoApplyMode.KEEP_APPLIED the state of any previously applied PromotionResult is 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 same PromotionOrderResults can be obtained later
by calling PromotionsService.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel). After this method is called, please call getModelService().refresh(order)
or getModelService().save(order).updatePromotions in interface PromotionsServiceupdatePromotions in class DefaultPromotionEngineServicepromotionGroups - 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.public PromotionOrderResults getPromotionResults(AbstractOrderModel order)
PromotionsServicePromotionsService.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.getPromotionResults in interface PromotionsServicegetPromotionResults in class DefaultPromotionEngineServiceorder - The order to get the promotion results forpublic PromotionOrderResults getPromotionResults(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
PromotionsServicePromotionsService.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 calling
PromotionsService.updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel).getPromotionResults in interface PromotionsServicegetPromotionResults in class DefaultPromotionEngineServicepromotionGroups - 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.public void cleanupCart(CartModel cart)
PromotionsServicecleanupCart in interface PromotionsServicecleanupCart in class DefaultPromotionEngineServicecart - The Cart to delete the results forpublic void transferPromotionsToOrder(AbstractOrderModel source, OrderModel target, boolean onlyTransferAppliedPromotions)
PromotionsServicetransferPromotionsToOrder in interface PromotionsServicetransferPromotionsToOrder in class DefaultPromotionEngineServicesource - 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 transferedprotected SapPricingEnablementService getSapPricingEnablementService()
public void setSapPricingEnablementService(SapPricingEnablementService sapPricingEnablementService)
Copyright © 2018 SAP SE. All Rights Reserved.