@Deprecated public class PerfectPartnerPromotionHandler extends java.lang.Object implements PromotionHandler
PerfectPartnerPromotionHandler
applies a configured discount
(percentage or absolute) on a product, if the product itself and its partner
product have been added to the cart.TYPE
Constructor and Description |
---|
PerfectPartnerPromotionHandler()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
PriceInfo |
applyCartEntryPromotion(CommerceSession commerceSession,
Promotion promotion,
CommerceSession.CartEntry cartEntry)
Deprecated.
Apply a promotion to a cart line item.
|
PriceInfo |
applyOrderPromotion(CommerceSession commerceSession,
Promotion promotion)
Deprecated.
Apply a promotion to an order.
|
PriceInfo |
applyShippingPromotion(CommerceSession commerceSession,
Promotion promotion)
Deprecated.
Apply a promotion to an order's shipping amount.
|
java.lang.String |
getDescription(SlingHttpServletRequest request,
CommerceSession commerceSession,
Promotion promotion)
Deprecated.
Allows a promotion handler to define a custom, author-oriented message for a promotion.
|
java.lang.String |
getMessage(SlingHttpServletRequest request,
CommerceSession commerceSession,
Promotion promotion)
Deprecated.
|
java.util.Map<java.lang.Integer,java.lang.String> |
getMessages(SlingHttpServletRequest request,
CommerceSession commerceSession,
Promotion promotion)
Deprecated.
Allows a promotion handler to define shopper-oriented messages for a promotion.
|
void |
getPotentials(CommerceSession commerceSession,
Promotion promotion,
java.util.Map<java.lang.String,java.lang.String> potentials)
Deprecated.
|
void |
invalidateCaches()
Deprecated.
Informs the promotion handler that something under the promotions root has been edited, and the
handler should invalidate any caches it might be keeping.
|
public PerfectPartnerPromotionHandler()
public PriceInfo applyCartEntryPromotion(CommerceSession commerceSession, Promotion promotion, CommerceSession.CartEntry cartEntry) throws CommerceException
PromotionHandler
PriceInfo
instance
or null
if no discount was applied.applyCartEntryPromotion
in interface PromotionHandler
commerceSession
- The commerce session containing the cart.promotion
- The Promotion
to apply.cartEntry
- The cart line item within the session's cart.PriceInfo
), or null
.CommerceException
public PriceInfo applyOrderPromotion(CommerceSession commerceSession, Promotion promotion) throws CommerceException
PromotionHandler
PriceInfo
instance or
null
if no discount was applied.applyOrderPromotion
in interface PromotionHandler
commerceSession
- The commerce session containing the order.promotion
- The Promotion
to apply.PriceInfo
), or null
.CommerceException
public PriceInfo applyShippingPromotion(CommerceSession commerceSession, Promotion promotion) throws CommerceException
PromotionHandler
PriceInfo
instance or null
if no discount was applied.applyShippingPromotion
in interface PromotionHandler
commerceSession
- The commerce session containing the order.promotion
- The Promotion
to apply.PriceInfo
), or null
.CommerceException
@Deprecated public java.lang.String getMessage(SlingHttpServletRequest request, CommerceSession commerceSession, Promotion promotion) throws CommerceException
getMessage
in interface PromotionHandler
CommerceException
public java.lang.String getDescription(SlingHttpServletRequest request, CommerceSession commerceSession, Promotion promotion) throws CommerceException
PromotionHandler
The info.geometrixx.commons.impl.PerfectPartnerPromotionHandler
, for
instance, uses this to list the qualifying pairs of products in the current cart.
getDescription
in interface PromotionHandler
request
- The current request (used for access-control).commerceSession
- The current CommerceSession
.promotion
- The Promotion
.CommerceException
public java.util.Map<java.lang.Integer,java.lang.String> getMessages(SlingHttpServletRequest request, CommerceSession commerceSession, Promotion promotion) throws CommerceException
PromotionHandler
An order-specific promotion should return a single message with a -1
key.
A cart-entry-specific promotion should return its message(s) keyed to the cart entries they apply to.
getMessages
in interface PromotionHandler
request
- The current request (used for access-control).commerceSession
- The current CommerceSession
.promotion
- The Promotion
.-1
).CommerceException
public void getPotentials(CommerceSession commerceSession, Promotion promotion, java.util.Map<java.lang.String,java.lang.String> potentials) throws CommerceException
CommerceException
public void invalidateCaches()
PromotionHandler
invalidateCaches
in interface PromotionHandler
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"