Gift list: count the gifts
When an order is paid, Shopify Flow adds the units bought from a gift list to the list, so its page shows “2 of 6 gifted” and closes what is complete.
How it runs.
It starts in Shopify: no form involved.
- TriggerOrder paid
A product added to the cart from a gift list page carries the list with it, without anything to set up: the workflow finds it on the order.
- ConditionCheck if
- At least one line of the order was added from a gift list
Otherwise the workflow stops here.
- Action 1
Read the gift list the order came from (“Get metaobject entry”)
- Action 2
Add the units of each product to the list’s
giftedfield (“Run code”) - Action 3
Save the field on the list (“Send Admin API request”,
metaobjectUpdate)
What you need, and how to install it.
- Shopify Flow, free in Shopify
- Plan: Server The form that creates the lists needs the Server plan. The workflow itself uses only Flow’s own steps.
- Add-on: Metaobject creator
- Element:
metaobject-creatorwithdata-type="gift_list",customer-field="customer"and a quantity for each product (data-quantity-for) - Element: a list page with
smootify-metaobjectanddata-handle-param="l", and inside itsmootify-productwithdata-id="metaobject.products",data-requested="quantities"anddata-fulfilled="gifted", with its add to cart - Metaobject definition
gift_list, with Storefront access
Settings › Custom data › Metaobjects › Gift list
gift_listtitleSingle line textoccasionSingle line textdateSingle line textmessageMulti-line textproductsList of product referencesa checkbox group in the formcustomerCustomer referenceset by Smootify with customer-fieldquantitiesJSON: how many of each product the list asks forgiftedJSON: how many of each product are already boughtwritten by this workflowEach field's key is the Name of a field in the Webflow form, written exactly the same.
- Install Shopify Flow from the Shopify App Store. It is free in Shopify, but it is a separate app.
- In Shopify, create the metaobject definition
gift_listwith the fields below. Turn on Storefront access. - Switch on the Metaobject creator add-on in the Smootify dashboard.
- Place the Smootify element in Webflow:
metaobject-creatorwithdata-type="gift_list",customer-field="customer"and a quantity for each product (data-quantity-for). - Download the .flow file and import it in Shopify Flow.
- Create the Gift list definition with the fields above before importing: the workflow reads and writes the
giftedfield. - If your definition has another type than
gift_list, pick it again in the “Get metaobject entry” step after importing. - Keep the field keys
quantitiesandgifted. With other keys, changeFIELDin the “Run code” step and the key in the last step. - Turn the workflow on. The counts start with the next paid order: orders paid before are not counted.
- Test it once with a real submission or order, then turn the flow on.
Where people get stuck.
- 01
An order with products from two different lists counts only the last one. Guests usually open one list at a time.
- 02
A cancelled or refunded order does not take the gifts back: correct the
giftedfield of the list in the admin. - 03
The count does not stop a sale: two guests who buy the last unit at the same time both buy it.
- 04
giftedis written only by the workflow. Leave it empty when you create a list by hand.
Get the .flow file.
The file is ready. Download it, import it in Shopify Flow, then follow the install steps above.
Related.
Not part of a demo store.
Webflow writes.
Shopify reacts.
Forms that write to Shopify are on the Server plan, and Shopify Flow is free in Shopify. One Shopify app, billed on the store’s Shopify invoice.
- One app on the Shopify bill, not ten
- Free to build, pay only when you go live
- Works on Basic, Grow and Advanced
- Your 1.x store keeps working
- Every element stays yours to change
- Docs indexed in llms.txt