Table of Contents

Class FreeShippingReward

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

A reward that provides free shipping.

[Experimental("DWEX100001")]
[AddInLabel("Free Shipping")]
[AddInUseParameterSectioning(true)]
[AddInUseParameterGrouping(true)]
public sealed class FreeShippingReward : Reward, IParameterOptions, IParameterVisibility
Inheritance
FreeShippingReward
Implements
Inherited Members

Properties

AppliesTo

Determines if free shipping is following the shipping providers' free shipping check or overrules it and forces free shipping on any selected shipping provider.

[AddInParameterGroup("Reward")]
[AddInParameter("AppliesTo")]
[AddInLabel("Applies to")]
[AddInParameterEditor(typeof(RadioParameterEditor), "sortBy=Key;reloadOnChange=true")]
public FreeShippingDiscountAppliesToShippingProvider AppliesTo { get; set; }

Property Value

FreeShippingDiscountAppliesToShippingProvider

ContextType

The type of context the discount is applied to.

public override AdjustmentContextType ContextType { get; }

Property Value

AdjustmentContextType

ShippingProviders

The shipping providers eligible for free shipping.

[AddInParameterGroup("Reward")]
[AddInParameter("ShippingProviders")]
[AddInLabel("Shipping providers")]
[AddInParameterEditor(typeof(CheckListParameterEditor), "explanation=Applies to all the selected shipping providers, regardless of them being eligible or not. This takes full control.")]
public string? ShippingProviders { get; set; }

Property Value

string

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

context OrderAdjustmentContext

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

Returns

bool

Eligible(string)

public bool Eligible(string shippingMethodId)

Parameters

shippingMethodId string

Returns

bool

GetDiscountAmount(AdjustmentContext)

Gets the discount amount for the product.

public override 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 override string? GetDisplayValue(string parameterName)

Parameters

parameterName string

The name of the parameter.

Returns

string

GetHiddenParameterNames(string, object?)

public IEnumerable<string> GetHiddenParameterNames(string parameterName, object? parameterValue)

Parameters

parameterName string
parameterValue object

Returns

IEnumerable<string>

GetParameterOptions(string)

public IEnumerable<ParameterOption> GetParameterOptions(string parameterName)

Parameters

parameterName string

Returns

IEnumerable<ParameterOption>
To top