Custom Promotion - how to use a radio button in the UI?



I'm coding some custom promotion types.

I've noticed that some of the built-in promotion types have a radio button in their UI to select between "Percentage Off" / "Amount Off".

I'd like to do something similar - I want to use a radio button to show 1 of 2 properties on my promotion type..

How can I do it?


 - Ken

Jun 02, 2017 23:01


To customize UI for properties on your promotion type, you can create a BlockData for those properties like that

public class CustomProperties : BlockData
    public Type Property1
    public Type Property2

Then you need register an EditorDescriptor for that block to customize UI in the client side.

[EditorDescriptorRegistration(TargetType = typeof(CustomProperties))]
public class CustomPropertiesEditorDescriptor : EditorDescriptor
    public CustomPropertiesEditorDescriptor()
        ClientEditingClass = "js/editors/CustomPropertiesEditor";

Finally you create a dojo widget to render those properties using radio button as you want.

Hope that helps.


Edited, Jun 12, 2017 12:19

Is there a good example online showing how I can do this?  ("dojo widget"?)

I'd like to do something similar to how a "MonetaryReward" looks on a promotion.  Ideally I would just look in the code to see how that one works - but I can't seem to locate that source code....

Nov 08, 2017 22:57

Here is an overral example good for you.

Nov 09, 2017 4:39
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.