Hi,
I am doing an order edit to turn a variant into several variants in the order. The sum and the line item price will remain the same. There is a 20% discount code applied to all line_items in the order. The screenshot will show what I am doing now:
Prev:
1 item + shipping = 39.96 + 10 = $49.96
discount on line items = 39.96 * 0.2 = 7.992 = $7.99 (rounded down to 2 d.p)
Recording the doc, % discount on the whole order is recalcuated.
After my edit (the below discount calculation is according to my understand):
4 items + shopping = 39.96 + 10 = $49.96
discount on line items = 9.99 * 2 * 0.2 + 9.99 * 0.2 + 9.99 * 0.2 = 3.996 (rounded down to 2 d.p) + 1.998 (rounded down to 2 d.p) + 1.998 (rounded down to 2 d.p)
= 3.99 +1.99 + 1.99 = $7.97
So the new discount is $0.02 less than the original. The customer owes the order $0.02
I tried to check the discount application:
{“discount_application”: {“target_type”: “line_item”, “type”: “discount_code”, “value”: “20.0”, “value_type”: “percentage”, “allocation_method”: “across”, “target_selection”: “all”, “code”: “BOWLBUDDY”}}
The target selection is all. So my question is: Why Shopify doesn’t add all line items price and then apply the discount in the recalculation? Is it more reasonable this way?
Finally, how can I retain the discount remains as $7.99 so the order is not partially paid? I will apply the extra $0.02 discount on my own?
Does anyone have a similar experience?
