Support for allocation method on product percentage discounts #544
Replies: 2 comments 2 replies
-
I notice this discussion has been closed. Can you share with us if/how this will be handled? |
Beta Was this translation helpful? Give feedback.
-
Apologies, I didn't mean to close it, especially with no comment! It seems like the issue at hand is less about allocation method and more about control over rounding. Rounding to the smallest unit of the relevant currency is often a source of a small amount of error in the discount amount, unfortunately. It's not clear to me why you would want to amplify that error - that's certainly never our intent. Can you elaborate on what the impact of the current rounding behaviour is to either you, as an app developer, or to a merchant that uses your app? |
Beta Was this translation helpful? Give feedback.
-
Function behavior v automatic discount behavior
A function-based product percentage discount is always applied using the allocation method "across".
This is in fact not aligned with how standard automatic discounts work.
A standard automatic product percentage discount uses the allocation method "each". This is also true for a standard discount code.
Impact of the allocation method
This is important because using the wrong method results in a subtly different discount amount due to the different rounding strategies.
Example
Assume a customer adds 7 items to the cart of a product variant that is sold for $67.96.
Assume a discount function applies a 10% product discount to this line (resulting in allocation method "across").
The discounted price for 7 items will be $67.96 x 7 = $475.72 - ($475.72 x 0.1 = $47.572, which is floored to $47.57) = $428.15
If the same 10% discount is applied using an automatic discount (resulting in allocation method "each"), the the discounted price for 7 items will be $67.96 - ($67.96 x 0.1 = $6.796, which is floored to $6.79) = $61.17, multiplied by 7 = $428.19
The difference between both calculation methods is 4 cents.
Proposed solution
Developers should have control over which allocation method should be applied.
The default method should be aligned with the way standard percentage discounts work, i.e. they should use allocation method "each".
Beta Was this translation helpful? Give feedback.
All reactions