November Happy Hour will be moved to Thursday December 5th.

Class Discount

Base class for discounts in the system. All discounts should inherit this class.

Implements
System.ICloneable
System.Runtime.Serialization.ISerializable
Namespace: Mediachase.Commerce.Orders
Assembly: Mediachase.Commerce.dll
Version: 12.17.2
Syntax
[Obsolete("Use promotion system in EPiServer.Commerce.Marketing instead. Will be removed in a future major release, but not earlier than August 2018.")]
public abstract class Discount : SimpleObject, IStorageObject, ICloneable, ISerializable

Constructors

Discount()

Initializes a new instance of the Discount class.

Declaration
public Discount()

Discount(SerializationInfo, StreamingContext)

Initializes a new instance of the Discount class.

Declaration
protected Discount(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The info.

System.Runtime.Serialization.StreamingContext context

The context.

Properties

DiscountAmount

Gets or sets the discount amount. Either fixed money value or percentage.

Declaration
public decimal DiscountAmount { get; set; }
Property Value
Type Description
System.Decimal

The discount amount.

DiscountCode

Gets or sets the discount code. Also known as a coupon code.

Declaration
public string DiscountCode { get; set; }
Property Value
Type Description
System.String

The discount code.

DiscountId

Gets or sets the discount id.

Declaration
public int DiscountId { get; set; }
Property Value
Type Description
System.Int32

The discount id.

DiscountName

Gets or sets the name of the discount.

Declaration
public string DiscountName { get; set; }
Property Value
Type Description
System.String

The name of the discount.

DiscountValue

Gets or sets the discount amount. The amount of discount that was applied. It will equal to DiscountAmount if it is a fixed monetary value. For the percentage based discount this value will be different.

Declaration
public decimal DiscountValue { get; set; }
Property Value
Type Description
System.Decimal

The discount value.

DisplayMessage

Gets or sets the display message.

Declaration
public string DisplayMessage { get; set; }
Property Value
Type Description
System.String

The display message.

OrderGroupId

Gets or sets the order group id.

Declaration
public int OrderGroupId { get; set; }
Property Value
Type Description
System.Int32

The order group id.

Methods

CreateDeleteCommand()

Creates the delete command.

Declaration
protected override DataCommand CreateDeleteCommand()
Returns
Type Description
DataCommand
Overrides

CreateInsertCommand()

Creates the insert command.

Declaration
protected override DataCommand CreateInsertCommand()
Returns
Type Description
DataCommand
Overrides

CreateParameters(DataCommand)

Creates the parameters.

Declaration
protected virtual void CreateParameters(DataCommand command)
Parameters
Type Name Description
DataCommand command

The command.

CreateUpdateCommand()

Creates the update command.

Declaration
protected override DataCommand CreateUpdateCommand()
Returns
Type Description
DataCommand
Overrides

GetObjectData(SerializationInfo, StreamingContext)

Gets the object data.

Declaration
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type Name Description
System.Runtime.Serialization.SerializationInfo info

The info.

System.Runtime.Serialization.StreamingContext context

The context.

Overrides

Implements

System.ICloneable
System.Runtime.Serialization.ISerializable