Discussing Shopify Functions development, deployment, and usage in Shopify apps.
I'm currently developing a shopify app that is composed of a checkout ui extension and a shopify function. These two are meant to interact with each other via cart attributes. I have not developed any admin dashboard for the app yet.
I've successfully tested my react-based checkout ui extension against a development store that has Checkout Extensibility enabled by running `yarn dev` in the app root folder and navigating to the provided url that goes through ngrok. I can see my UI extension and interact with it.
My expectation (based on https://community.shopify.com/c/shopify-functions/interaction-between-checkout-ui-extensions-and-fun...) is that by setting cart attributes via my ui extension (
order-discounts-function-rust
These extensions need to be deployed to be manually tested.
One testing option is to use a separate app dedicated to staging.
I would expect the function to be running on the same store as my UI Extension is. What am I missing? Thanks.
Solved! Go to the solution
This is an accepted solution.
ok. so, i managed to get this working. i was missing the step "configure the function" in the shopify function lifecycle mentioned here: https://shopify.dev/api/functions#lifecycle-of-a-shopify-function
this was an extra step for my use-case that i did not think i needed, since i had understood that a shopify function is meant to return the discount nodes applicable to the cart and the configuration to provide the function as input is coming from my api backend without the need for the merchant to do any "configuration".
currently still testing the functionality, but everything seems to work as documented now.
I have installed the app into my development store and have modified the function for it to return discounts by default in an effort to see anything at all, but notice no change.
Total # of runs for my function is still at 0. Can someone assist?
This is an accepted solution.
ok. so, i managed to get this working. i was missing the step "configure the function" in the shopify function lifecycle mentioned here: https://shopify.dev/api/functions#lifecycle-of-a-shopify-function
this was an extra step for my use-case that i did not think i needed, since i had understood that a shopify function is meant to return the discount nodes applicable to the cart and the configuration to provide the function as input is coming from my api backend without the need for the merchant to do any "configuration".
currently still testing the functionality, but everything seems to work as documented now.
I'm running into the same issue with an app we're testing, could you expand on what you did to fix it? My understanding was also that we wouldn't need to add a configuration step if the configuration was already provided elsewhere, what did you do to get this working as intended?