Class VoucherCondition
- Namespace
- Dynamicweb.Ecommerce.Orders.Adjustments.Conditions
- Assembly
- Dynamicweb.Ecommerce.dll
A condition that checks if a voucher is applied to an order.
[Experimental("DWEX100001")]
[AddInLabel("Voucher")]
[AddInUseParameterSectioning(true)]
public sealed class VoucherCondition : Condition, IParameterOptions, IParameterVisibility
- Inheritance
-
VoucherCondition
- Implements
- Inherited Members
Properties
ContextType
The type of context the condition is applied to.
public override AdjustmentContextType ContextType { get; }
Property Value
VoucherCode
The voucher code to check against the OrderAdjustmentContexts voucher code.
[AddInParameterGroup("Condition")]
[AddInParameter("VoucherCode")]
[AddInLabel("Voucher code")]
[AddInParameterEditor(typeof(TextParameterEditor), "")]
public string? VoucherCode { get; set; }
Property Value
VoucherListId
The voucher list to check against the OrderAdjustmentContexts voucher code.
[AddInParameterGroup("Condition")]
[AddInParameter("VoucherList")]
[AddInLabel("Voucher list")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "")]
public int VoucherListId { get; set; }
Property Value
VoucherType
Determines if the condition should check against a voucher list or a voucher code.
[AddInParameterGroup("Condition")]
[AddInParameter("VoucherType")]
[AddInLabel("Voucher type")]
[AddInParameterEditor(typeof(DropDownParameterEditor), "none=false;required=true")]
public VoucherType VoucherType { get; set; }
Property Value
Methods
GetDisplayValue(string)
Returns the UI display format for the condition, visible in the overview screens where conditions are used.
public override string? GetDisplayValue(string parameterName)
Parameters
parameterNamestringThe name of the parameter.
Returns
GetHiddenParameterNames(string, object?)
public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)
Parameters
Returns
GetParameterOptions(string)
public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)
Parameters
parameterNamestring
Returns
IsSatisfied(AdjustmentContext)
Returns whether the condition is satisfied.
public override bool IsSatisfied(AdjustmentContext context)
Parameters
contextAdjustmentContextThe current context, either a OrderAdjustmentContext or ProductAdjustmentContext.