Class OrderAmountReward
- Namespace
- Dynamicweb.Ecommerce.Orders.Adjustments.Rewards
- Assembly
- Dynamicweb.Ecommerce.dll
A reward that applies to the total amount to an order.
[Experimental("DWEX100001")]
[AddInLabel("Amount (order)")]
[AddInUseParameterSectioning(true)]
[AddInUseParameterGrouping(true)]
public sealed class OrderAmountReward : Reward, IParameterOptions
- Inheritance
-
OrderAmountReward
- Implements
- Inherited Members
Constructors
OrderAmountReward()
public OrderAmountReward()
Properties
Amount
The amount to discount.
[AddInParameterGroup("Reward")]
[AddInParameter("Amount")]
[AddInLabel("Amount")]
[AddInParameterEditor(typeof(NumberParameterEditor), "minValue=0d;required=true")]
public double Amount { get; set; }
Property Value
ContextType
The type of context the discount is applied to.
public override AdjustmentContextType ContextType { get; }
Property Value
CurrencyCode
The currency code for the currency the Amount is in.
[AddInParameterGroup("Reward")]
[AddInParameter("Currency")]
[AddInLabel("Currency")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false")]
public string? CurrencyCode { get; set; }
Property Value
IncludedVat
If true, the discount will be calculated including VAT.
[AddInParameterGroup("Reward")]
[AddInParameter("IncludeVAT")]
[AddInLabel("")]
[AddInParameterEditor(typeof(RadioParameterEditor), "")]
public bool IncludedVat { 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 override 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 override 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 override string? GetDisplayValue(string parameterName)
Parameters
parameterNamestringThe name of the parameter.
Returns
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring