Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hey everyone!! I'm looking to "ideally" create a shopify flow that adds a product to the first 100 customers who place an order using a unique discount code.
This is ideal only as I would like to try and avoid using another app 😭 I've thought if setting the discount to only have 100 uses but we'd like for the promo to continue being used and only reward the first ones to use it.
My current thought is somehow creating a counter in flow to keep track of it but then the logic seems to become unmanageable. Does anyone have any ideas or thoughts on how to tackle this? I'm still open to an app if that's my only option lol
It's not clear exactly what you are doing now and what you are looking to change. Can you elaborate a bit more?
Looking at the API, there isn't an easy way to do it because the number of uses isn't available via the order. The order does carry the discount code as a string, but it doesn't know how often it was used. You could possibly count every use of a discount by using a metafield. Something like:
- Order created
- if order.discountCode == "XYZ":
- if shop / metafields / discount_code_use < 100:
- Add order line item
- Update shop metafield (increment by 1)
The downside of this is that you might occasionally go over 100 if two orders came in at the same time. Also it wouldn't reflect the current uses of an existing discount code.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024