Creating two discounts in a single button

Modified on Mon, 11 Jul 2022 at 02:26 PM

Overview

    There are times when you may want to have a single button fire off multiple discounts, an example might be when employees get 10% off some products and 15% off others.  To do this you need to create two separate custom discounts to identify each group of products and the desired discounts and then wrap them into a button using the compose command (click here to see an article on using commands)


Note: this is of moderate complexity and assumes that you are familiar with task pad button commands. Be sure to contact our support team at support@rite.us or 888-267-7483 for assistance.


Procedure

An example might look like this:


[{
Command: 'CloudRetailer.Plugins.Discounting.Pos.PerformCustomDiscount',
Parameter:  
"{ 
Range: 'All', 
CustomDiscountId: '8a1cae30-afcd-49c3-a136-19d4912691fa'
}"
},
{Command: 'CloudRetailer.Plugins.Discounting.Pos.PerformCustomDiscount',
Parameter:  
"{ 
Range: 'All', CustomDiscountId: '3774606b-1d74-4860-8134-19d49144a4a0' 
}"
}]

When you test your button you'll notice that one discount fires but the other does not.  This is intentional, the second discount overrides the first but you can use the "ApplySeparately" parameter to change this behavior.  Here's the same command using this method:

[{Command: 'CloudRetailer.Plugins.Discounting.Pos.PerformCustomDiscount',
Parameter:  
"{ 
Range: 'All', CustomDiscountId: '8a1cae30-afcd-49c3-a136-19d4912691fa',        
ApplySeparately: true 
}",
},
{Command: 'CloudRetailer.Plugins.Discounting.Pos.PerformCustomDiscount',
Parameter:  
"{ 
Range: 'All', CustomDiscountId: '3774606b-1d74-4860-8134-19d49144a4a0',        
ApplySeparately: true 
}",
},
{Command: 'CloudRetailer.Plugins.Discounting.Pos.PerformCustomDiscount',
Parameter:  
"{ 
Range: 'All', CustomDiscountId: 'eac1b021-4db8-4e3b-9e31-19d9b0163dbe',       
 ApplySeparately: true 
}"
}]


Here is a video showing one task pad button example using the above Command and Parameter Code:



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article