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
ContextType
The type of context the discount is applied to.
public abstract AdjustmentContextType ContextType { get; }
Property Value
DiscountId
The Id of the group the discount is attached to.
public required string DiscountId { get; set; }
Property Value
Id
public string Id { get; set; }
Property Value
Settings
The AddIn parameters of the discount serialized as xml.
public string? Settings { get; set; }
Property Value
SortOrder
public required int SortOrder { get; set; }
Property Value
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
contextOrderAdjustmentContextThe current context containing the order or orderline where the discount is being applied to, depending on the AdjustmentContextType.
Returns
GetDiscountAmount(AdjustmentContext)
Gets the discount amount for the product.
public abstract PriceInfo? GetDiscountAmount(AdjustmentContext context)
Parameters
contextAdjustmentContextThe 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
parameterNamestringThe name of the parameter.