getCampaign()
:
Campaign
Returns the campaign this particular instance of the promotion is defined in.
getCoupons()
:
Collection
Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion.
getCustomerGroups()
:
Collection
Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion.
getEndDate()
:
Date
Returns the effective end date of this instance of the promotion.
getExclusivity()
:
String
Returns the promotion's exclusivity specifying how the promotion can be combined with other promotions.
getID()
:
String
Returns the unique ID of the promotion.
getSourceCodeGroups()
:
Collection
Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion.
getStartDate()
:
Date
Returns the effective start date of this instance of the promotion.
isActive()
:
boolean
Returns 'true' if promotion is active, otherwise 'false'.
isBasedOnCoupon()
:
boolean
Returns 'true' if the promotion is triggered by a coupon, false otherwise.
isBasedOnCoupons()
:
boolean
Returns 'true' if the promotion is triggered by coupons, false otherwise.
isBasedOnCustomerGroups()
:
boolean
Returns 'true' if the promotion is triggered by customer groups, false otherwise.
isBasedOnSourceCodes()
:
boolean
Returns 'true' if the promotion is triggered by source codes, false otherwise.
isEnabled()
:
boolean
Returns true if promotion is enabled, otherwise false.
isRefinable()
:
boolean
Returns true if promotion is refinable, otherwise false.
getCalloutMsg
Returns the callout message of the promotion.
Returns:
Callout message of the promotion.
getCampaign
Returns the campaign this particular instance of the promotion is defined
in.
Note: If this promotion is defined as part of an AB-test, then a Campaign
object will be returned, but it is a mock implementation, and not a true
Campaign. This behavior is required for backwards compatibility and
should not be relied upon as it may change in future releases.
Returns:
Campaign of the promotion.
getCombinablePromotions
getCombinablePromotions()
:
String[]
Returns the promotion's combinable promotions. Combinable promotions is a set of promotions or groups this
promotion can be combined with.
Returns:
The promotion's set of combinable promotions.
getConditionalDescription
Returns a description of the condition that must be met for this
promotion to be applicable.
The method and the related attribute have been deprecated. Use the
getDetails() method instead.
Returns:
Condition promotion description.
getCoupons
Returns the coupons directly assigned to the promotion or assigned to the campaign of the promotion.
If the promotion is not based on coupons (see isBasedOnCoupons()), or no coupons is assigned to the
promotion or its campaign, an empty collection is returned.
Returns:
Coupons assigned to promotion in no particular order.
getCustom
Returns the custom attributes for this extensible object.
getCustomerGroups
Returns the customer groups directly assigned to the promotion or assigned to the campaign of the promotion.
If the promotion is not based on customer groups (see isBasedOnCustomerGroups()), or no customer group is assigned to the
promotion or its campaign, an empty collection is returned.
Returns:
Customer groups assigned to promotion in no particular order.
getDescription
Returns the description of the promotion.
Method is deprecated and returns the same value as getCalloutMsg().
Returns:
Description of the promotion.
getDetails
Returns the detailed description of the promotion.
Returns:
Detailed promotion description.
getEndDate
Returns the effective end date of this instance of the promotion. If no
explicit end date is defined for the promotion, the end date of the
containing Campaign or AB-test is returned.
Returns:
End date of the promotion, or null if no end date is defined.
getExclusivity
Returns:
Promotion exclusivity
getID
Returns the unique ID of the promotion.
Returns:
ID of the promotion.
getImage
Returns the reference to the promotion image.
Returns:
Image of the promotion.
getLastModified
Returns the date that this object was last modified.
Returns:
the date that this object was last modified.
getMutuallyExclusivePromotions
getMutuallyExclusivePromotions()
:
String[]
Returns the promotion's mutually exclusive Promotions. Mutually exclusive Promotions is a set of promotions or
groups this promotion cannot be combined with.
Returns:
The promotion's set of mutually exclusive Promotions.
getName
Returns the name of the promotion.
Returns:
Name of the promotion.
getPromotionalPrice
Returns the promotional price for the specified product. The promotional
price is only returned if the following conditions are met:
- this promotion is a product promotion without purchase conditions,
i.e. is of type 'Without qualifying products'.
- this promotion's discount is Discount.TYPE_AMOUNT,
Discount.TYPE_PERCENTAGE, Discount.TYPE_FIXED_PRICE, or
Discount.TYPE_PRICEBOOK_PRICE.
- specified product is one of the discounted products of the
promotion.
- the product has a valid sales price for quantity 1.0.
In all other cases, the method will return Money.NOT_AVAILABLE. It is
not required that this promotion be an active customer
promotion.
NOTE: the method might be extended in the future to support more
promotion types.
To calculate the promotional price, the method uses the current sales
price of the product for quantity 1.0, and applies the discount
associated with the promotion to this price. For example, if the product
price is $14.99, and the promotion discount is 10%, the method will
return $13.49. If the discount is $2 off, the method will return $12.99.
If the discount is $10.00 fixed price, the method will return $10.00.
Parameters:
product
-
the product to calculate the discount for
Returns:
the price of the passed product after promotional discount is applied, or Money.NOT_AVAILABLE if any of the restrictions on product or promotion are not met.
getPromotionalPrice
This method follows the same logic as
getPromotionalPrice(Product) but prices are calculated based
on the option values selected in the specified option model.
Parameters:
product
-
the product to calculate the discount for
optionModel
-
the option model to use when calculating
Returns:
the price of the passed product after promotional discount is applied, or Money.NOT_AVAILABLE if any of the restrictions on product or promotion are not met.
getPromotionClass
Returns:
Promotion class or null if the promotion rule has not been configured.
getQualifierMatchMode
getQualifierMatchMode()
:
String
Returns the qualifier matching mode specified by this promotion. A
promotion may have up to 3 qualifier conditions based on whether it is
customer-group based, coupon based, and/or source-code based. A promotion
may require for example that a customer belong to a certain customer
group and also have a certain coupon in the cart in order for the
promotion to apply. This method returns QUALIFIER_MATCH_MODE_ALL if it is
necessary that all the qualifier conditions are satisfied in order for
this promotion to apply for a given customer. Otherwise, this method
returns QUALIFIER_MATCH_MODE_ANY indicating that at least of the
qualifier conditions must be satisfied.
Note: currently QUALIFIER_MATCH_MODE_ALL is only supported for promotions
assigned to campaigns, and not those assigned to AB-tests.
Returns:
the qualifier matching mode specified by this promotion, either QUALIFIER_MATCH_MODE_ALL or QUALIFIER_MATCH_MODE_ANY.
getRank
Returns the promotion's rank. Rank is a numeric attribute that you can specify.
Promotions with a defined rank are calculated before promotions without a defined rank.
If two promotions have a rank, the one with the lowest rank is calculated first.
For example, a promotion with rank 10 is calculated before one with rank 30.
Returns:
The promotion's rank.
getSourceCodeGroups
Returns the source code groups directly assigned to the promotion or assigned to the campaign of the promotion.
If the promotion is not based on source code groups (see isBasedOnSourceCodes()), or no source code group is assigned to the
promotion or its campaign, an empty collection is returned.
Returns:
Source code groups assigned to promotion in no particular order.
getStartDate
Returns the effective start date of this instance of the promotion. If no
explicit start date is defined for this instance, the start date of the
containing Campaign or AB-test is returned.
Returns:
Start date of the promotion, or null if no start date is defined.
getTags
Returns the promotion's tags. Tags are a way of categorizing and organizing promotions. A promotion can have many
tags. Tags will be returned in alphabetical order.
Returns:
The promotion's set of tags.
isActive
isActive()
:
boolean
Returns 'true' if promotion is active, otherwise 'false'.
A promotion is active if its campaign is active, and the promotion
is enabled, and it is scheduled for now.
Returns:
true if promotion is active, otherwise false.
isBasedOnCoupon
isBasedOnCoupon()
:
boolean
Returns 'true' if the promotion is triggered by a coupon,
false otherwise.
Returns:
true if promotion is triggered by coupon, otherwise false.
isBasedOnCoupons
isBasedOnCoupons()
:
boolean
Returns 'true' if the promotion is triggered by coupons,
false otherwise.
Returns:
true if promotion is triggered by coupons, otherwise false.
isBasedOnCustomerGroups
isBasedOnCustomerGroups()
:
boolean
Returns 'true' if the promotion is triggered by customer groups,
false otherwise.
Returns:
true if promotion is triggered by customer groups, otherwise false.
isBasedOnSourceCodes
isBasedOnSourceCodes()
:
boolean
Returns 'true' if the promotion is triggered by source codes,
false otherwise.
Returns:
true if promotion is triggered by source codes, otherwise false.
isEnabled
isEnabled()
:
boolean
Returns true if promotion is enabled, otherwise false.
Returns:
true if promotion is enabled, otherwise false.
isRefinable
isRefinable()
:
boolean
Returns true if promotion is refinable, otherwise false.
Returns:
true if promotion is refinable, otherwise false.