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

Commerce promotion discount conditional property

Vote:
 

I'd like to add custom properties to a discount in Commerce similar to the out of the box "At the following discount" properties where there are two radio buttons and clicking on each will show an associated property e.g. clicking Percentage off shows an input to enter the %.
Clicking Amount off hides the percentage and shows inputs for an amount for each currency etc.

How can I achieve this?

Thanks.

Commerce version 11.8

#194173
Jun 14, 2018 23:49
Vote:
 

That is not trivial. You would have to create a widget to handle that, and then register this 

[EditorDescriptorRegistration(TargetType = typeof(SelectReward))]
public class SelectRewardEditorDescriptor : EditorDescriptor
{
/// <summary>
/// Initializes a new instance of the <see cref="SelectRewardEditorDescriptor "/> class.
/// </summary>
public SelectRewardEditorDescriptor ()
{
ClientEditingClass = "epi-ecf-ui/contentediting/editors/SelectRewardEditor";
}
}

SelectReward is the name of the block data which contain your properties 

#194185
Jun 15, 2018 10:43
* 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.