Class PromotionData
Represents a content based promotion item.
Inheritance
Implements
Inherited Members
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 14.46.1Syntax
[AvailableContentTypes(Availability.None)]
[AdministrationSettings(CodeOnly = true, GroupName = "marketing")]
[CLSCompliant(false)]
public abstract class PromotionData : BasicContent, IInitializableContent, IModifiedTrackable, IContent, IContentData, IReadOnly, IChangeTrackable, IExportable, IContentSecurable, ISecurable
Examples
/// <summary>
/// Sample promotion that gives a percentage discount if a customer buys more than a given number of items from a selection of products.
/// </summary>
[ContentType]
public class PercentagePromotionSample : EntryPromotion
{
/// <summary>
/// Gets or sets the conditions that defines when the promotion is fulfilled or not.
/// </summary>
[PromotionRegion(PromotionRegionName.Condition)]
public virtual PurchaseQuantity Condition { get; set; }
/// <summary>
/// Gets or sets the percentage of discount applied when the promotion is fulfilled.
/// </summary>
[PromotionRegion(PromotionRegionName.Reward)]
public virtual int PercentageDiscount { get; set; }
}
Constructors
PromotionData()
Represents a content based promotion item.
Declaration
protected PromotionData()
Examples
/// <summary>
/// Sample promotion that gives a percentage discount if a customer buys more than a given number of items from a selection of products.
/// </summary>
[ContentType]
public class PercentagePromotionSample : EntryPromotion
{
/// <summary>
/// Gets or sets the conditions that defines when the promotion is fulfilled or not.
/// </summary>
[PromotionRegion(PromotionRegionName.Condition)]
public virtual PurchaseQuantity Condition { get; set; }
/// <summary>
/// Gets or sets the percentage of discount applied when the promotion is fulfilled.
/// </summary>
[PromotionRegion(PromotionRegionName.Reward)]
public virtual int PercentageDiscount { get; set; }
}
Properties
Banner
Gets or sets the banner image of the promotion.
Declaration
[UIHint("image")]
[Display(Order = 15, GroupName = "EPiServerCMS_SettingsPanel")]
public virtual ContentReference Banner { get; set; }
Property Value
| Type | Description |
|---|---|
| ContentReference |
Coupon
Gets or sets coupon information.
Declaration
[Display(Order = 40, GroupName = "Coupons", Name = "")]
public virtual CouponData Coupon { get; set; }
Property Value
| Type | Description |
|---|---|
| CouponData |
Description
Gets or sets the description of the promotion.
Declaration
[UIHint("textarea")]
[Display(Order = 10, GroupName = "EPiServerCMS_SettingsPanel", Prompt = "/commerce/properties/description/prompt")]
public virtual string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
DiscountType
Gets whether the promotion is for an order or individual line items or a shipment.
Declaration
public abstract DiscountType DiscountType { get; }
Property Value
| Type | Description |
|---|---|
| DiscountType |
ExcludedCatalogItems
Gets or sets the list of excluded catalog items (catalogs, categories or entries). Excluded catalog items will not be used to calculate for this promotion.
Declaration
[DistinctList]
[Display(Order = 45, Name = "Excluded Catalog Items")]
[AllowedTypes(new Type[] { typeof(CatalogContent), typeof(NodeContent), typeof(EntryContentBase) })]
[PromotionRegion("Exclusion")]
public virtual IList<ContentReference> ExcludedCatalogItems { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<ContentReference> |
ExcludedItems
Gets or sets the list of excluded promotional items (campaign root, campaigns or promotions). Excluded campaigns or promotions will not be combined with this promotion.
Declaration
[DistinctList]
[ScaffoldColumn(false)]
[AllowedTypes(new Type[] { typeof(PromotionData), typeof(SalesCampaign), typeof(SalesCampaignFolder) })]
public virtual IList<ContentReference> ExcludedItems { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<ContentReference> |
IsActive
Gets or sets the status of the promotion.
Declaration
[Display(Order = 30, GroupName = "SchedulingAndStatus")]
public virtual bool IsActive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Priority
Gets or sets the priority of promotion. The higher value, the higher priority.
Declaration
[ScaffoldColumn(false)]
public virtual int Priority { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
RedemptionLimits
Gets or sets redemption limits.
Declaration
[Display(Order = 50, GroupName = "RedemptionLimits", Name = "")]
public virtual RedemptionLimitsData RedemptionLimits { get; set; }
Property Value
| Type | Description |
|---|---|
| RedemptionLimitsData |
Schedule
Gets or sets the promotion schedule.
Declaration
[Display(Order = 20, GroupName = "SchedulingAndStatus", Name = "")]
public virtual PromotionSchedule Schedule { get; set; }
Property Value
| Type | Description |
|---|---|
| PromotionSchedule |
Methods
CreateWriteableCloneImplementation()
Represents a content based promotion item.
Declaration
protected override object CreateWriteableCloneImplementation()
Returns
| Type | Description |
|---|---|
| object |
Overrides
SetDefaultValues(ContentType)
Represents a content based promotion item.
Declaration
public override void SetDefaultValues(ContentType contentType)
Parameters
| Type | Name | Description |
|---|---|---|
| ContentType | contentType |