Discussing Shopify Functions development, deployment, and usage in Shopify apps.
Hi, I am currently developing a custom app that creates an automated discount using `discountAutomaticAppCreate` and facing issue when deploying.
Summary:
Everything works fine in the DEV environment, I can see that the Extension Log is firing perfectly fine.
However, it doesn't work in the LIVE environment which is on Shopify Plus Enterprise Platform Plan.
I have done the following steps for deployment:
When I go to the LIVE environment, adding an item to the cart doesn't send any log to the function.
If I understand it correctly, it should trigger as long as the app is installed and discount is available.
I've checked the other thread that mentioned Draft Checkout, and I can confirm that the Checkout is currently LIVE.
Are there any steps that I've missed?
Any help will be appreciated.
Thank you so much.
Solved! Go to the solution
This is an accepted solution.
Hi @syanaputra --
Not seeing success run logs for a production shop is expected, as noted in function docs. So it could be either that your function isn't executing for some reason, or it is running but it's not outputting any discounts.
Since you have the checkout editor available, I assume you are not on checkout.liquid in this Plus shop, which would stop the function from running. If the shop previously used checkout.liquid, it could be that discount combinations / extensible discounts are not enabled. Merchant support for the Plus shop can check on this.
You can also try initiating a hard crash in your function code (throw in JavaScript, panic! in Rust), which would appear in your run logs and could be shared from the discount admin.
-Nick
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
This is an accepted solution.
Hi @syanaputra --
Not seeing success run logs for a production shop is expected, as noted in function docs. So it could be either that your function isn't executing for some reason, or it is running but it's not outputting any discounts.
Since you have the checkout editor available, I assume you are not on checkout.liquid in this Plus shop, which would stop the function from running. If the shop previously used checkout.liquid, it could be that discount combinations / extensible discounts are not enabled. Merchant support for the Plus shop can check on this.
You can also try initiating a hard crash in your function code (throw in JavaScript, panic! in Rust), which would appear in your run logs and could be shared from the discount admin.
-Nick
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
Hi @Nick_Wesselman,
Thank you so much! That doc is something that I totally missed which caused the confusion on my end.
It turns out that the function was attaching properly, but my logic was flawed causing it to not run properly.
For anyone who probably has the same confusion as me:
Based on this doc: https://shopify.dev/docs/apps/functions/testing-and-debugging#debugging-functions-in-production
Only function failure logs shared by users are available in your Partner Dashboard.
In other words, the "Success" logs will never be available in production. Only the failure logs (and need to be shared by the store owner).