Automatically Tag Out-of-Stock Products by Inventory Location
Automatically apply or remove 'out-of-stock' tags to products based on real-time inventory levels across all or specific locations, enhancing store management.
The Problem
Manually updating product tags when inventory changes is a tedious, error-prone task that leads to outdated product pages and missed sales opportunities. Without accurate tags, customers might order unavailable items, leading to frustrating cancellations and increased customer service overhead.
What This Automation Solves
This Shopify Flow automation triggers whenever a `product variant inventory quantity changed`. It then iterates through each location to precisely `add product tags` like 'out-of-stock-[location]' when stock hits zero, or `remove product tags` upon restock, while also managing a global 'out-of-stock' tag based on your `allow sell when out of stock` setting.
When to Use This Automation
- You manage inventory across multiple physical locations or warehouses and need location-specific stock visibility.
- You want to instantly hide or highlight products that are genuinely unavailable for purchase.
- You need to segment products for marketing campaigns (e.g., 'email me when back in stock') or internal reporting.
Workflow
Trigger
Step 1This workflow starts when the inventory level changes for a specific product variant
Loop
Step 2Iterate over each of the inventory locations that stocks the item.
Condition
Step 3Check to see if the inventory levels for the iterated location is greater than 1.
Action
Step 4Tag the product when it's available for the location (True branch)
Action
Step 5Tag the product when it's available for purchase in the iterated location (False branch)
Condition
Step 6Check if the merchant allows the product to be sold when it's out-of-stock.
Action
Step 7Tag the product as out-of-stock
Action
Step 8If the product was previously tagged out-of-stock, remove that tag.
Step-by-Step Setup
- 1
Initiate the workflow with the `Product variant inventory quantity changed` trigger.
- 2
Add a `For each` loop action, iterating `For each inventory location` that stocks the variant.
- 3
Within the loop, create a `Condition` to check if the `inventory quantity` at the iterated location is `equal to 0`.
- 4
In the 'true' branch (out of stock at location), use `Add product tags` to tag the product with "out-of-stock-[location name]". In the 'false' branch (in stock at location), use `Remove product tags` for any existing "out-of-stock-[location name]" tag.
- 5
After the loop, add a final `Condition` to check if the product variant's *total* `inventory quantity` across all locations is `equal to 0` AND if `allow sell when out of stock` is `false`. If true, `Add product tags` "out-of-stock". Otherwise, `Remove product tags` "out-of-stock".
Related Questions
- How can I prevent customers from ordering out-of-stock items?
- By instantly tagging products as 'out-of-stock' or 'sold-out', you can use theme customizations to hide these products, display clear 'sold out' messages, or disable the 'Add to Cart' button, preventing accidental purchases and managing expectations.
- Can this Flow differentiate between low stock and zero stock?
- Yes, you can modify or add additional `Condition` checks in the Flow. For example, check for inventory `less than 5` for a 'low-stock' tag, and a separate `equal to 0` check for an 'out-of-stock' tag, allowing for nuanced inventory management.
- How do these tags help with marketing efforts?
- Inventory status tags allow you to create dynamic product collections for targeted marketing (e.g., 'back in stock' email flows), pause ads for unavailable items, or filter products for specific promotions, ensuring your marketing is always relevant and effective.
- What if I allow selling products when out of stock (backordering)?
- If your `allow sell when out of stock` setting is true, you can adjust the Flow to `add product tags` like 'backorderable' instead of 'out-of-stock'. This differentiates products that are temporarily unavailable but still purchasable for future fulfillment.
Recommended Tools & Apps
Launch this automation
Open Shopify Flow and use this page as your setup blueprint.
Merchant Insight
Combine these inventory tags with your theme's collection conditions to automatically show/hide products or with other Flows to notify your team via Slack when a critical item hits zero stock at a specific warehouse. It’s about leveraging a
Related Automations
How to Get Email Alerts for Low Product Variant Inventory
Automate internal email notifications instantly when any product variant's inventory dips below your critical threshold, ensuring you never miss a restock opportunity.
How to Automatically Hide Out-of-Stock Products on Shopify
Automatically unpublish products from your online store when inventory hits zero, and republish them when restocked, ensuring customers always see available items.
Automatically Republish Back-in-Stock Products
Automatically make products visible on your online store the moment they come back in stock, ensuring customers can purchase without delay.