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?