[BUG] Product combinations with multiple proposals incorrect

When multiple product discounts target the same cart line, it appears there’s an issue with the way the discounts combine. When there is only one value returned, it correctly selects the highest discount for a cart line. However, when there are multiple discount candidates returned, the lower discount applies.

This was raised on Github late last year, but it has popped up in a different way for us, but the issue seems exactly the same.

Taken from the github issue page (because it’s a good example of what works vs doesn’t).

Affected by bug:

{
  "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
        }
      }
    }
  ]
}

Not affected by bug:

{
  "discountApplicationStrategy": "FIRST", # or MAXIMUM or ALL -- any would be equivalent
  "discounts": [
    {
      "message": "$100 OFF",
      "targets": [
        {
          "cartLine": {
            "id": "gid://shopify/CartLine/0",
            "quantity": 1
          }
        },
        {
          "cartLine": {
            "id": "gid://shopify/CartLine/1",
            "quantity": 1
          }
        }
      ],
      "value": {
        "fixedAmount": {
          "amount": "100",
          "appliesToEachItem": true
        }
      }
    }
  ]
}

Hey!

Have connected with the product team internally on this, will let you know what the update is on this.

1 Like