November Happy Hour will be moved to Thursday December 5th.

Class MonetaryRewardExtensions

Extension methods for MonetaryReward

Inheritance
System.Object
MonetaryRewardExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Commerce.Marketing
Assembly: EPiServer.Business.Commerce.dll
Version: 13.30.0
Syntax
public static class MonetaryRewardExtensions

Methods

GetAmountForCurrency(MonetaryReward, ILineItem, Currency)

Gets the reward for a specific line item in a specific currency

Declaration
public static decimal GetAmountForCurrency(this MonetaryReward reward, ILineItem lineItem, Currency currency)
Parameters
Type Name Description
MonetaryReward reward

The object containing the reward settings.

ILineItem lineItem

The line item to get the reward for.

Currency currency

The currency to get the reward in.

Returns
Type Description
System.Decimal

The amount of reward that should be applied to the specified line item.

GetDiscountAmountForCurrency(MonetaryReward, Currency)

Gets the discount amount of the current reward for a perticular Currency.

Declaration
public static decimal GetDiscountAmountForCurrency(this MonetaryReward reward, Currency currency)
Parameters
Type Name Description
MonetaryReward reward

The object containing the reward settings.

Currency currency

The currency of the current IOrderGroup.

Returns
Type Description
System.Decimal

GetRewardType(MonetaryReward)

Gets the RewardType for the current reward.

Declaration
public static RewardType GetRewardType(this MonetaryReward reward)
Parameters
Type Name Description
MonetaryReward reward

The object containing the reward settings.

Returns
Type Description
RewardType

If

HasRewardInCurrency(MonetaryReward, Currency)

Checks if there is any reward for the specified currency.

Declaration
public static bool HasRewardInCurrency(this MonetaryReward reward, Currency currency)
Parameters
Type Name Description
MonetaryReward reward

The object containing the reward settings.

Currency currency

The currency to evaluate reward for.

Returns
Type Description
System.Boolean

true if there is a reward greater than 0 for the specified currency; otherwise false.