I am currently upgrading a site from 13 to 17 and having a problem with how to update the label view for my custom Discount Reward Provider.
In v13 I had this that worked, a very simple setup.
An attribute that set the LabelView
[DiscountRewardProvider("CQTDiscountReward", "Portal Discount Reward", LabelView = "\\App_Plugins\\CqtBO\\labelViews\\CQTDiscountReward.html")]
public class PortalDiscountRewardProvider : DiscountRewardProviderBase<PortalDiscountRewardProviderSettings>
And in the html file there was one line
Order {{ model.priceType | ucSplitCamelCase }} Discount
One attribute and one formatting line. This is what it looks like.

Now I am in the v17 world and having difficulty understanding the weirdness to do with Localization and imports and extensions and stuff. No problem with the actual C# code itself but having difficulty making it display properly in the BO.
The docs at Discount Rules / Rewards is sorta helpful but donât understand the last section about localisation.
It says âit is neceserray to provide localizable labels.â (sic) but it doesnât say where these labels and keys are to be placed.
My provider is now defined with this
[DiscountRewardProvider("CQTDiscountReward",
Label = "Portal Discount Reward",
Description ="A reward that adjusts the order amount",
ViewUiAlias = "My.PropertyEditorUi.CqtDiscountRewardProviderLabel")]
with settings
[DiscountRewardProviderSetting(Key = "priceType",
Label = "Price Type",
Description = "The price that will be affected by this reward/fee. \n SubtotalPrice will be used regardless of this setting."
)]
public OrderPriceType PriceType { get; set; } = OrderPriceType.SubtotalPrice;
and this works in that the picker modal in the BO shows this just fine. ( go to Commerce store mgtâDiscountsâmy discount. Select Add Reward and I can see my custom type with the right name of Portal Discount Reward and description)
Where I am having trouble is how the selected reward and settings are displayed.
In the Discount property editor, the name is blank when it should show âOrder {priceType} Discountâ
and when edited, the single setting for Price Type shows the label value as the description.
Things I have tried
Created an umbraco-package.json file with an extension in the collection
"extensions": [
{
"type": "propertyEditorUi",
"alias": "My.PropertyEditorUi.CqtDiscountRewardProviderLabel",
"name": "Portal Discount Reward Label",
"element": "/App_Plugins/CqtBO/CQTDiscountRewardProviderLabel.element.js"
}
Created the *.element.js file with code that is copied from the U doc page and modified for my rule. Essentially the same.
Amazingly this is accepted and loaded by the BO when the whole thing runs.
However.
Nothing is displayed and the browser is throwing a nasty âSyntaxError: Invalid or unexpected tokenâ on the line for @customElement.
import { customElement, html, property, when } from "@umbraco-cms/backoffice/external/lit";
import { UmbLitElement } from "@umbraco-cms/backoffice/lit-element";
@customElement('uc-cqt-portal-discount-reward-provider-label')
export class UcCqtPortalDiscountRewardProviderLabelElement extends UmbLitElement {
@property()
value?: Record<string, unknown>;
render() {
return when(this.value, () => html`
Order Discount
`)
}
}
export default UcCqtPortalDiscountRewardProviderLabelElement;
declare global {
interface HTMLElementTagNameMap {
'uc-cqt-portal-discount-reward-provider-label': UcCqtPortalDiscountRewardProviderLabelElement;
}
}
So am at a loss here. No syntax errors in the js code itself which is a simple as I can get it. I took out the use of this.value just in case but it didnt help
I gather it might(??) be something to do with Localization but I donât know where to do that.
I am not a FE dev so this is all rather mysterious.
Could anyone assist me please.
Thanks.


