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

Custom promotion that round to nearest divisible by X

Vote:
 

I'm creating a sort of "incognito" custom promotion that looks like original prices in the UI and I want the discounted prices to be divisible by 5 (USD) or 10 (SEK). Since it's a percentage discount some prices could end up as some random number like 112,50 kr which doesn't fit in as a standard price.

I have a custom processor but it seems like the evaluate-method runs with a blanket percentage for the entire order. I might need to set custom percentage per item to get them all to a nice round number. Is there a way to force Evaluate(...) to run on individual items or should I go another route?

#230133
Oct 30, 2020 8:07
Vote:
 

Create a custom promotion that takes the divisible number. Now in Evaluate () while returning RewardDescription, you will RewardDescription.CreateMoneyReward object.

For example, if your product price is £13 and you divide it by 5, it will be £2.6.

Now if you want product price to be £3 (a rounded value) then your unitDiscount will be £10 that you pass with RewardDescription.CreateMoneyReward object

#248355
Feb 08, 2021 20:42
* 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.