Check if orders contain 7 or more products from a specific collection

Check if orders contain 7 or more products from a specific collection

SZE14
Visitor
2 0 0

Hey,

 

Now I want to create a flow to check if my customer's order contains 7 or more products from a specific collection.

 

Sometimes, an order will contain different products from different collections at the same time.

For example, the order contain product A from Collection 1, product B from Collection 1, and product C from Collection 2. And now I want to check if the order contains 7 or more products from Collection 1.

 

How can I set the condition? I just found that I can set conditions to check the collection id (collections_item.id) , but I can't check there have how many line items from the collection.

 

Thank you very much!

Replies 2 (2)

paul_n
Shopify Staff
1182 144 277

There isn't currently a way to count in the condition step. If Flow has a filter step, you could take a list (like the lineItems) and then filter that list by the same kind of condition and then count afterwards.

 

For now, if you need to count you have to do it via Liquid in an action. What action do you need to do with that count?

Paul_N | Flow Product Manager @ Shopify
- Finding Flow useful? Leave us a review
- Need Flow help? Check out our help docs.
- Building for Flow? Check out Flow's dev docs.
SZE14
Visitor
2 0 0

Hi,

I need to add a product to this order after counting.