Discounts passed as an array with individual line id targets do not observe combinations #576
Replies: 5 comments 4 replies
-
Hey there! 👋 Developer from the Discounts team here. This is definitely a bug, considering the equivalent Function result that uses two targets within the same discount works as expected. We're looking into it. Thanks for the report! |
Beta Was this translation helpful? Give feedback.
-
Thanks @adamjford, I appreciate the fast turnaround! |
Beta Was this translation helpful? Give feedback.
-
Possible WorkaroundsThe bug only arises when a product Function discount that has multiple proposals being applied is attempting to combine with another product discount that targets the same cart line(s). If the same discount value and message is being applied by each proposal, one possible workaround would be to combine the two proposals. For example, for the above FunctionRunResult, applying the workaround would look like this:
|
Beta Was this translation helpful? Give feedback.
-
Hi @adamjford Is there an update on this issue? |
Beta Was this translation helpful? Give feedback.
-
Follow up question to above suggested workaround: When we say:
What do we mean by “combine.” Obviously we’re gunning for the response to be the expected result: Expected result: Variant A: the 10% applies since it provides a better discount ($150 beats $100) What we are not looking for this to do is for the 10% to stack or combine with the $100 off which would be double dipping 2 discounts. Can we confirm that the workaround suggested would function as suggested here? @adamjford |
Beta Was this translation helpful? Give feedback.
-
Assume a cart contains two line items:
Offer $100 off on each of those two products using a discount function:
Assume the function uses line ids to target the lines that must be discounted:
For example:
{ "discountApplicationStrategy": "ALL", "discounts": [ { "message": "$100 OFF", "targets": [ { "cartLine": { "id": "gid://shopify/CartLine/0", "quantity": 1 } } ], "value": { "fixedAmount": { "amount": "100", "appliesToEachItem": true } } }, { "message": "$100 OFF", "targets": [ { "cartLine": { "id": "gid://shopify/CartLine/1", "quantity": 1 } } ], "value": { "fixedAmount": { "amount": "100", "appliesToEachItem": true } } } ] }
At checkout both lines receive the correct discount.
Now add a Shopify discount code (ABC10) at checkout:
Expected result:
Actual result:
The discount code is not applied "ABC10 couldn't be used with your existing discounts."
Beta Was this translation helpful? Give feedback.
All reactions