Table of Contents

Class Reward

Namespace
Dynamicweb.Ecommerce.Orders.Adjustments
Assembly
Dynamicweb.Ecommerce.dll

The base class for all discounts. A discount is applied when all conditions on a discount group is satisfied.

[Experimental("DWEX100001")]
public abstract class Reward : ConfigurableAddIn
Inheritance
Reward
Derived
Inherited Members

Properties

Active

public bool Active { get; set; }

Property Value

bool

ContextType

The type of context the discount is applied to.

public abstract AdjustmentContextType ContextType { get; }

Property Value

AdjustmentContextType

DiscountId

The Id of the group the discount is attached to.

public required string DiscountId { get; set; }

Property Value

string

Id

public string Id { get; set; }

Property Value

string

Settings

The AddIn parameters of the discount serialized as xml.

public string? Settings { get; set; }

Property Value

string

SortOrder

public required int SortOrder { get; set; }

Property Value

int

Methods

ApplyReward(OrderAdjustmentContext)

Applies the discount. The way a reward is applied is up to the implementation. It can use the OrderAdjustmentContext to get a reference to the order and apply the discount to the order.

public abstract bool ApplyReward(OrderAdjustmentContext context)

Parameters

context OrderAdjustmentContext

The current context containing the order or orderline where the discount is being applied to, depending on the AdjustmentContextType.

Returns

bool

GetDiscountAmount(AdjustmentContext)

Gets the discount amount for the product.

public abstract PriceInfo? GetDiscountAmount(AdjustmentContext context)

Parameters

context AdjustmentContext

The context containing the product being fetched.

Returns

PriceInfo

The discount amount for the product.

GetDisplayValue(string)

Returns the UI display format for the discount, visible in the Discount overview screen.

public abstract string? GetDisplayValue(string parameterName)

Parameters

parameterName string

The name of the parameter.

Returns

string
To top