Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.

Only one of multiple order discounts applied

VitaDev
Shopify Partner
10 0 0

I am having two different order discounts backed by different functions active, that should apply tiered discounts to the cart subtotal. One function outputs a percentual discount if the cart price exceeds a certain threshold. The other function outputs a discount with a fixed amount if the cart price exceeds the same threshold. The help article on discount combinations says this combination should be possible and discounts should be applied subsequently. But when I am testing it, always only one discount is applied, mostly the percentual discount.

Both functions output valid discounts. The discount is applied if I only have one order discount active at a time, so both function should work correctly. I provide the function outputs for a run on the same cart below.

 

Percentual order discount:

{
  "discountApplicationStrategy": "MAXIMUM",
  "discounts": [
    {
      "conditions": [
        {
          "orderMinimumSubtotal": {
            "excludedVariantIds": [
              "gid://shopify/ProductVariant/36839682605215"
            ],
            "minimumAmount": 50,
            "targetType": "ORDER_SUBTOTAL"
          }
        }
      ],
      "message": "Aktion",
      "targets": [
        {
          "orderSubtotal": {
            "excludedVariantIds": [
              "gid://shopify/ProductVariant/36839682605215"
            ]
          }
        }
      ],
      "value": {
        "percentage": {
          "value": 10
        }
      }
    }
  ]
}

 Fixed amount order discount:

{
  "discountApplicationStrategy": "MAXIMUM",
  "discounts": [
    {
      "conditions": [
        {
          "orderMinimumSubtotal": {
            "excludedVariantIds": [
              "gid://shopify/ProductVariant/36839682605215"
            ],
            "minimumAmount": 50,
            "targetType": "ORDER_SUBTOTAL"
          }
        }
      ],
      "message": "Geschenk",
      "targets": [
        {
          "orderSubtotal": {
            "excludedVariantIds": [
              "gid://shopify/ProductVariant/36839682605215"
            ]
          }
        }
      ],
      "value": {
        "fixedAmount": {
          "amount": 19
        }
      }
    }
  ]
}

As you can see the outputs only differ in their message and value, the conditions are the same. Is there anything I am missing so that only one discount is applied?

Replies 0 (0)