Discussing Shopify Functions development, deployment, and usage in Shopify apps.
Hey, we are in the process of creating a shopify store, and have developed a cart validation function similar to https://shopify.dev/docs/api/functions/reference/cart-checkout-validation and a product discount function similar to https://shopify.dev/docs/apps/selling-strategies/discounts/experience/getting-started.
Solved! Go to the solution
This is an accepted solution.
Really appreciate the help and the quick response. Have DM'd you.
Hey @matoow
Thanks for all the details. Looks like a plan issue:
> Only stores on a Shopify Plus plan can use custom apps that contain Shopify Function APIs.
This would explain the function working in your development store but not the (basic) store. Curious that the cart validation function is working 🤔
Scott | Developer Advocate @ Shopify
Hey Scott,
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:-
Only custom apps on the Shopify Plus plan can use the Cart and Checkout Validation API.
https://shopify.dev/docs/api/functions/reference/cart-checkout-validation
I notice that in the https://partners.shopify.com/ site the app is down as a 'custom' app.
Would you happen to know how I go about getting a definitive answer to this? I have tried asking customer services, but they have directed me here.
Any help appreciated.
Thanks,
Matt
Checking with the Functions team - can you please DM me your (basic plan) store URL?
Scott | Developer Advocate @ Shopify
This is an accepted solution.
Really appreciate the help and the quick response. Have DM'd you.
For anyone following along - this was a bug on our end (some functions were running on Basic plans). This has now been resolved.
Scott | Developer Advocate @ Shopify
I'm hitting into an error when building the Rust function from this Tutorial page:
https://shopify.dev/docs/apps/selling-strategies/blockchain/tokengating/build-a-tokengating-app/shop...
Is it related or should I open a separate issue?
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`