Solved

DiscountApplicationStrategy.All is not a recognized option for new scaffolded product-discount

DeeDee-TDY
Shopify Partner
45 4 1

I scaffolded a new product-discount extension function today and the shopify.app.toml file reflects api-version 2024-01 and the shopify.extension.toml file shows api_version 2023-10. The product-discount package.json shows app and cli versions 3.53.0.

I would like to use the new discountApplicationStrategy of All per https://shopify.dev/changelog/new-discountapplicationstrategy-option-for-product-discount-function-a... which states: EFFECTIVE JANUARY 01, 2024 The Product Discount Function API now supports setting discountApplicationStrategy to "ALL" in the FunctionRunResult.

Unfortunately, All is not a recognized discountApplicationStrategy option. I tested in my actual function code on a test store which confirms that upon running the app, All is not a recognized discountApplicationStrategy option.

DeeDeeTDY_3-1704908182585.png

InvalidOutputError

[

  {

    "path": [

      "discountApplicationStrategy"

    ],

    "explanation": "Expected value to not be null"

  }

]

I attempted to manually modify the shopify.extension.toml file to use api_version 2024-01, re-ran the dev command and tested, but the same behavior occurred. How do I update my function to use the new discountApplicationStrategy of All?

Accepted Solution (1)

Nick_Wesselman
Shopify Staff
117 29 45

This is an accepted solution.

If you are upgrading an extension to a new API version, be sure you've followed all the steps here, including pulling the latest schema:

https://shopify.dev/docs/apps/functions/input-output#api-versions

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

View solution in original post

Reply 1 (1)

Nick_Wesselman
Shopify Staff
117 29 45

This is an accepted solution.

If you are upgrading an extension to a new API version, be sure you've followed all the steps here, including pulling the latest schema:

https://shopify.dev/docs/apps/functions/input-output#api-versions

Nick Wesselman | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog