[Bug] discountApplicationStrategy with `All` Type not working when using with multiple variants

Topic summary

Issue: discountApplicationStrategy set to “ALL” (intended to stack multiple discounts on the same line item) behaves inconsistently when multiple product variants are involved.

Observed behavior:

  • Single variant: Two percentage discounts (20% and 10%) targeting different quantities of the same variant are applied correctly. Screenshots show expected stacked results.
  • Multiple variants: A 20% discount targets two variants (A qty 3, B qty 2) and a 10% discount targets variant A (qty 3). The second discount is not applied correctly. Screenshots indicate the discrepancy.

Related report:

  • Another user sees no discount when the same variant is targeted by two discounts at different rates, if the second target omits the “quantity” field. Adding “quantity” to the second target restores the discount, suggesting a regression requiring “quantity” even though it was previously optional.

Status and outcomes:

  • No official fix or guidance provided. One user confirmed the issue persists in a specific store and switched development to another dev store.
  • Workaround: Explicitly include “quantity” for each target may help in some cases.

Open questions:

  • Whether Shopify Functions now require “quantity” for all targets and if this is a platform bug or a change in validation.
Summarized with AI on December 17. AI used: gpt-5.

We have a app that with a function that using discountApplicationStrategy with All to have multiple multiple discounts applied to same product variant

the following output is for when same product and only 1 variant:

{
  "discountApplicationStrategy": "ALL",
  "discounts": [
    {
      "value": {
        "percentage": {
          "value": 20
        }
      },
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/46960668311869",
            "quantity": 5
          }
        }
      ],
      "message": "Volume discount"
    },
    {
      "value": {
        "percentage": {
          "value": 10
        }
      },
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/46960668311869",
            "quantity": 3
          }
        }
      ],
      "message": "Volume discount"
    }
  ]
}

This do working as expected, the two discounts is applied correctly, the following is the result:

BUT, when it involved with 2 variants from the same product, the second’s discount is not applied correctly

the following is the output and result:

{
  "discountApplicationStrategy": "ALL",
  "discounts": [
    {
      "value": {
        "percentage": {
          "value": 20
        }
      },
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/46960668311869",
            "quantity": 3
          }
        },
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/46960668377405",
            "quantity": 2
          }
        }
      ],
      "message": "Volume discount"
    },
    {
      "value": {
        "percentage": {
          "value": 10
        }
      },
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/46960668311869",
            "quantity": 3
          }
        }
      ],
      "message": "Volume discount"
    }
  ]
}

We believed this is a bug as it is working when only single variant but not when multiple

Please let us know or if the Shopify’s function expecting any format of output to handle this situation

Thanks in advance!

2 Likes

I am experiencing the same a similar issue. When multiple targets are returned that have the same variant ID and are discounted at different rates no discount is being applied.

This function output results in no discount:

{
  "discounts": [
    {
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/45808962994471",
            "quantity": 2
          }
        }
      ],
      "value": {
        "percentage": {
          "value": 10
        }
      },
      "message": "Bundle Discount"
    },
    {
      "targets": [
        {
          "productVariant": {
            "id": "gid://shopify/ProductVariant/45808962994471"
          }
        }
      ],
      "value": {
        "percentage": {
          "value": 20
        }
      },
      "message": "Vendor Discount"
    }
  ],
  "discountApplicationStrategy": "ALL"
}

The issue I’m experiencing seems different to OP. I was able to get my discount working by adding a “quantity” to the second target. This appears to be a bug as “quantity” property is not a required field and my understanding is that the discount should apply without it. This used to work but seems to be a recently introduced bug.

Got the same issue here, any update on a solution ?

no solution, it just happened on 1 store, I continue my development using another dev store