Both functions are part of an ‘app’ that I’ve developed under a partner account linked to the same organisation.
Both functions run fine in my development store.
However, when deploying it to our live store (currently on a basic plan) the cart validation works, but the product-discount does not.
I have copied the client credentials for the app, created an access token, and verified that the product discount function is present on the store via the graphql interface, but when I try to CREATE the discount via graphql as per step 4 in the tutorial above, it returns ‘function not found’.
I am wondering if this could be related to the fact that the store I’m deploying to is on the basic and not the plus plan as it suggests is required. However, the cart-validation function is executing and working as expected on the same store.
Do I need to have a plus store to run the cart-validation function?
Could this be the issue with the deployment of product-discount? Or something else?
Many thanks for the reply. I’d really appreciate knowing if my cart validation function is supposed to work on a basic plan. I’m wondering if I’ve somehow managed to get an illegal setup, because the documentation states:-
Shopify Plus
Only custom apps on the Shopify Plus plan can use the Cart and Checkout Validation API.
This one seems easy to fix by renaming to shopify_function:
#[shopify_function_target(query_path = "src/run.graphql", schema_path = "schema.graphql")]
| ^^^^^^^^^^^^^^^^^^^^^^^ help: an attribute macro with a similar name exists: `shopify_function`
Then there are a host of issues with output and input that I’m not sure how to solve:
discount_application_strategy: output::DiscountApplicationStrategy::FIRST,
| ^^^^^^ use of undeclared crate or module `output`
Some(input::InputDiscountNodeMetafield { value }) => Configuration::from_str(&value),
| ^^^^^ use of undeclared crate or module `input`