Hi everyone,
When using the new Discount Function, I’ve run into an issue when trying to apply both product and order discounts at the same time.
Here’s the scenario:
- I apply a product discount to a cart line (e.g., Cart Line A).
- In my order discount, I add that same cart line’s ID to
excludedCartLineIds.
When I do this, none of my product discounts are applied — only the order discount shows up.
Here’s an example output from my function:
{
"operations": [
{
"productDiscountsAdd": {
"candidates": [
{
"message": "code",
"targets": [
{
"cartLine": {
"id": "gid://shopify/CartLine/1",
"quantity": 4
}
}
],
"value": {
"fixedAmount": {
"amount": "99",
"appliesToEachItem": true
}
}
},
{
"message": "code",
"targets": [
{
"cartLine": {
"id": "gid://shopify/CartLine/2",
"quantity": 1
}
}
],
"value": {
"fixedAmount": {
"amount": "99",
"appliesToEachItem": true
}
}
}
],
"selectionStrategy": "ALL"
}
},
{
"orderDiscountsAdd": {
"candidates": [
{
"message": "DiscountMixer",
"conditions": [
{
"orderMinimumSubtotal": {
"excludedCartLineIds": [],
"minimumAmount": "5000"
}
}
],
"targets": [
{
"orderSubtotal": {
"excludedCartLineIds": [
"gid://shopify/CartLine/2",
"gid://shopify/CartLine/3",
"gid://shopify/CartLine/4"
]
}
}
],
"value": {
"fixedAmount": {
"amount": "10"
}
}
}
],
"selectionStrategy": "FIRST"
}
}
]
}
What happens:
- If
gid://shopify/CartLine/2exists in both the product discount targets and in the order discount’sexcludedCartLineIds, then the product discounts are completely ignored and only the order discount is applied. - If I remove that cart line from
excludedCartLineIds, both discounts apply and combine as expected.
Question:
Is this intended behavior in the new Discount Function? If so, is there a way to allow product discounts to still apply even if that line is excluded from the order discount’s calculation?
Thanks in advance!