public interface PromotionsService
updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel) methods to evaluate the promotions that can be applied to a cart or order.getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel) methods to retrieve the promotions calculated for an order.getProductPromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.product.ProductModel) methods to retrieve the promotions that a ProductModel can be part
of.cleanupCart(de.hybris.platform.core.model.order.CartModel) method to removed these items.| Modifier and Type | Method and Description |
|---|---|
void |
cleanupCart(CartModel cart)
Delete the the stored promotion results for a Cart.
|
java.util.List<? extends AbstractPromotionModel> |
getAbstractProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product)
Get the ordered list of
AbstractPromotionModel instances that are related to the ProductModel
specified. |
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. |
PromotionGroupModel |
getDefaultPromotionGroup()
Lookup the default promotion group created by the promotions extension.
|
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
boolean evaluateRestrictions)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
boolean evaluateRestrictions,
java.util.Date date)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
boolean evaluateRestrictions,
ProductModel product)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
boolean evaluateRestrictions,
ProductModel product,
java.util.Date date)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
java.util.Date date)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product)
Get the ordered list of
OrderPromotion instances. |
java.util.List<OrderPromotionModel> |
getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product,
java.util.Date date)
Get the ordered list of
OrderPromotion instances. |
java.util.List<ProductPromotionModel> |
getProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product)
Get the ordered list of
ProductPromotion instances that are related to the ProductModel specified. |
java.util.List<ProductPromotionModel> |
getProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups,
ProductModel product,
boolean evaluateRestrictions,
java.util.Date date)
Get the ordered list of
ProductPromotion instances that are related to the ProductModel specified. |
java.lang.String |
getPromotionDescription(AbstractPromotionModel promotion)
Get the description of given promotion.
|
PromotionGroupModel |
getPromotionGroup(java.lang.String identifier)
Lookup a promotion group with the given identifier.
|
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.
|
java.util.Collection<AbstractPromotionRestrictionModel> |
getRestrictions(AbstractPromotionModel promotion)
Get the collection of
AbstractPromotionRestrictionModel instances. |
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. |
java.util.List<ProductPromotionModel> getProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product)
ProductPromotion instances that are related to the ProductModel specified.promotionGroups - The promotion groups to evaluateproduct - The product that the promotions are related toProductPromotion related to the ProductModel specifiedjava.util.List<ProductPromotionModel> getProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, java.util.Date date)
ProductPromotion instances that are related to the ProductModel specified.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 dateProductPromotion related to the ProductModel specifiedjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups)
OrderPromotion instances.promotionGroups - The promotion groups to evaluateOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, java.util.Date date)
OrderPromotion instances.promotionGroups - The promotion groups to evaluatedate - The date to check for promotions, typically the current dateOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product)
OrderPromotion instances.promotionGroups - The promotion groups to evaluateproduct - The product to pass to restrictionsOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product, java.util.Date date)
OrderPromotion instances.promotionGroups - The promotion groups to evaluateproduct - The product to pass to restrictionsdate - The date to check for promotions, typically the current dateOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions)
OrderPromotion instances.promotionGroups - The promotion groups to evaluateevaluateRestrictions - Flag, pass false to ignore any restrictions specified on the promotions, pass true to observe the
restrictions.OrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, java.util.Date date)
OrderPromotion instances.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 dateOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product)
OrderPromotion instances.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 trueOrderPromotionjava.util.List<OrderPromotionModel> getOrderPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, boolean evaluateRestrictions, ProductModel product, java.util.Date date)
OrderPromotion instances.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 dateOrderPromotionjava.util.List<? extends AbstractPromotionModel> getAbstractProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product)
AbstractPromotionModel instances that are related to the ProductModel
specified.promotionGroups - The promotion groups to evaluateproduct - The product that the promotions are related toAbstractPromotionModel related to the ProductModel specifiedjava.util.List<? extends AbstractPromotionModel> getAbstractProductPromotions(java.util.Collection<PromotionGroupModel> promotionGroups, ProductModel product, boolean evaluateRestrictions, java.util.Date date)
AbstractPromotionModel instances that are related to the ProductModel
specified.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 dateAbstractPromotionModel related to the ProductModel specifiedPromotionOrderResults updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order)
AbstractOrder 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 getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel).promotionGroups - The promotion groups to evaluateorder - The order object to update with the results of the promotionsPromotionOrderResults updatePromotions(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
AbstractOrderModel object.
The resulting promotions can be retrieved later by calling getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel). The order must be
calculated before calling this method. 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 getPromotionResults(de.hybris.platform.core.model.order.AbstractOrderModel). After this method is called, please call getModelService().refresh(order)
or getModelService().save(order).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.PromotionOrderResults getPromotionResults(AbstractOrderModel order)
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.order - The order to get the promotion results forPromotionOrderResults getPromotionResults(java.util.Collection<PromotionGroupModel> promotionGroups, AbstractOrderModel order, boolean evaluateRestrictions, PromotionsManager.AutoApplyMode productPromotionMode, PromotionsManager.AutoApplyMode orderPromotionMode, java.util.Date date)
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
updatePromotions(java.util.Collection<de.hybris.platform.promotions.model.PromotionGroupModel>, de.hybris.platform.core.model.order.AbstractOrderModel).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.void cleanupCart(CartModel cart)
cart - The Cart to delete the results forvoid transferPromotionsToOrder(AbstractOrderModel source, OrderModel target, boolean onlyTransferAppliedPromotions)
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 transferedPromotionGroupModel getDefaultPromotionGroup()
PromotionGroupModel getPromotionGroup(java.lang.String identifier)
identifier - identifier of the promotion group to look forjava.lang.IllegalArgumentException - if identifier is nulljava.util.Collection<AbstractPromotionRestrictionModel> getRestrictions(AbstractPromotionModel promotion)
AbstractPromotionRestrictionModel instances.promotion - the promotion which restrictions should be returnedAbstractPromotionRestrictionModel instances attached to this promotion.java.lang.String getPromotionDescription(AbstractPromotionModel promotion)
promotion - the promotion to get the description forCopyright © 2018 SAP SE. All Rights Reserved.