I am fairly new to liquid so I hope this will be a quick answer for someone. I am looking to do the following in Shopify flow.
I currently have a metafield that will be updated every time a customer purchases an item. For instance, they have purchased 10 items in the past and have a new order of 10, the Shopify Flow will update the metafield to 20.
This is currently where I am stuck. As I cannot seem to find the the current metafield value before adding the new order quantity.
You can’t access metafields that way in Flow yet. Storefront does something special to fetch metafields values by namespace. In Flow, you loop over order.customer.metafields … FYI if you click add variable and choose the metafield value it will show you the loop part.
Tracking cumulative purchases is smart—it usually drives credit decisions in B2B (higher buyers get higher limits). But here’s the gap: even if you know their purchase history, Shopify won’t block checkout when they’re about to exceed their limit. You’d need custom logic or a separate check. TermShield automates it: set a credit limit per customer and we block checkout when they’d exceed it.