Skip to content

Umbraco Commerce > Discount rules and rewards #7513

@MiguelLopez6

Description

@MiguelLopez6

What type of issue is it? (Choose one - delete the others)

Wrong documentation

What article/section is this about?

(link here)

Describe the issue

In the example code for custom discount reward provider, the attributes used on the properties of the TieredPercentageSettings class are wrong. They are of type DiscountRuleProviderSetting, but they should be DiscountRewardProviderSetting.

So this code:

public class TieredPercentageSettings
{
    [DiscountRuleProviderSetting(Key = "baseTierPercentage")]
    public decimal BaseTierPercentage { get; set; }

    [DiscountRuleProviderSetting(Key = "midTierThreshold")]
    public decimal MidTierThreshold { get; set; }

    [DiscountRuleProviderSetting(Key = "midTierPercentage")]
    public decimal MidTierPercentage { get; set; }

    [DiscountRuleProviderSetting(Key = "highTierThreshold")]
    public decimal HighTierThreshold { get; set; }

    [DiscountRuleProviderSetting(Key = "highTierPercentage")]
    public decimal HighTierPercentage { get; set; }
}

should be changed to:

public class TieredPercentageSettings
{
    [DiscountRewardProviderSetting(Key = "baseTierPercentage")]
    public decimal BaseTierPercentage { get; set; }

    [DiscountRewardProviderSetting(Key = "midTierThreshold")]
    public decimal MidTierThreshold { get; set; }

    [DiscountRewardProviderSetting(Key = "midTierPercentage")]
    public decimal MidTierPercentage { get; set; }

    [DiscountRewardProviderSetting(Key = "highTierThreshold")]
    public decimal HighTierThreshold { get; set; }

    [DiscountRewardProviderSetting(Key = "highTierPercentage")]
    public decimal HighTierPercentage { get; set; }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions