App reviews, troubleshooting, and recommendations
I am trying to find a way to validate the discount that is apply to a cart in a checkout validation function, but... I can't find any way to get the discount codes that have actually been apply. I would expect I have receive those in the Input to the function, but I can't see any fields in the GraphQL API to support this.
Does anyone know how I can get the discount codes that have been applied to a cart in a shopify function?
Thanks
Shopify Functions can't query which discounts have been applied to the cart.
Relevant discussion: https://github.com/Shopify/function-examples/discussions/574
Maybe you can try a Checkout UI extension?
Damn, that is a real shame. I'm finding I have to "workaround" so much.
Thanks for the quick reply
Hi Abel,
This is really a case of me wanting the server to validate the logic rather than the UI. I kind of ignored the client side solution because of this, however, with the limitations, I've changed my approach.
The UI extensions works good enough 🙂
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025