All things Shopify and commerce
I am new to Shopify development and I am thinking of creating a Qty Discount app to learn more about it.
I followed the tutorial on this page: https://shopify.dev/docs/apps/build/discounts/experience and got it working.
However, for my app, I want to allow customers to select products, collections, etc., to which the discount is applied.
For example, if you buy:
- 2 products A, B, or C, you will get 20% off.
- 3 products A, B, or C, you will get 30% off.
I know how to use Shopify Functions to calculate the discount and update the cart. However, I am not sure how or where to store these discount settings configured by the user. I was thinking of using Metaobjects but I am not sure if it is the right approach. If I store the data in custom Metaobjects, when a user adds a product to the cart, how can I quickly look through the Metaobjects and find the relevant discount to be applied to a product?
Does anyone have any ideas?
Hi @leele ,
This is Theodore from PageFly - Shopify Page Builder App.
Building a Qty Discount Shopify app? Here's how to store user-defined discounts:
Skip Metaobjects: Not ideal for discount rule lookup.
Use Shopify App Storage API:
Benefits:
Best regards,
Theodore | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025