Shopify Flow is an ecommerce automation platform that enables you to automate tasks and processes within your store and across your apps.
Hi!
I can't figure out how to build a flow that will tag an order that had more than 3 free items in it (4+ items at $0 each). I can do 1 item but not sure how to do for more. They are not necessary the same SKU.
Thanks for helping!
Solved! Go to the solution
This is an accepted solution.
You can write some liquid in the tag itself to count the number of free items. Something like:
{% assign free_count = 0 %}
{% for li in order.lineItems %}
{% if li.discountedTotalSet.shopMoney.amount <= 0 %}
{% increment free_count %}
{% endif %}
{% endfor %}
{%- if free_count >= 4 -%}YOUR_TAG{%- endif -%}
You may have to make that all fit on one line when you enter it into the tag field.
I don't know how to do this natively in Shopify but if you aren't able to find a solution and need a plan B, Order Automator app does a bunch of things like this. If there isn't an exact solution in the app, you can get free custom rules built to match your store's needs.
This is an accepted solution.
You can write some liquid in the tag itself to count the number of free items. Something like:
{% assign free_count = 0 %}
{% for li in order.lineItems %}
{% if li.discountedTotalSet.shopMoney.amount <= 0 %}
{% increment free_count %}
{% endif %}
{% endfor %}
{%- if free_count >= 4 -%}YOUR_TAG{%- endif -%}
You may have to make that all fit on one line when you enter it into the tag field.
Thanks. I didn't even know I could add liquid code in there. Will try this 🙂
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025