Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
Hello. I am reading the documentation on Storefront API and I'm incredibly confused. I want to apply a discount with a dynamic amount based on the items in my cart. How do I do this? Can I do this without creating a fixed code in shopify admin? Because then the customers can reuse the code.
Please give me an in-depth explanation. I have created a custom app to do this for me and it works, but I found out later that I cannot use shopify extensions on custom distribution, and can only use public distribution for it to work.
Hi Mandertx,
Creating a dynamic discount based on the items in a cart on Shopify requires using various APIs and scripting methods. These can include:
Hope this helps!
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog