Hi everyone,
Hope you’re well !
I am running a shop in US and Canada with 2 inventory locations (1 per country). I am using Shopify Markets to prevent people from the US to see Canada inventory and vice versa.
However, sometimes (I imagine because the market detection is IP based), it does not work well and some US folks are able to complete orders even though the US inventory is at 0. When this happens, the inventory at the US count goes below zero (or even further if it was already sitting at -1).
So I thought I would use Shopify flow as a second level barrier to automatically cancel any order that generates negative inventory level at any location taken individually on any of its line item.
I came up with this flow
However, this is not working well, as it only triggers if the sum of the inventory count at all location is negative. For example, if an order is placed, and it takes Product XYZ US inventory to -2 but Canada inventory still has 10 units of Product XYZ, it does not trigger because the Flow considers that the inventory level is still positive as it counts 8 units (sum of Canada + US).
I think there is a way to get Flow to make the check on a per-location basis, but my experience with Flow is limited, so I could not figure out how…
(I thought about modifying the default Tag out of stock products for a single location only template and inserting a GetData to grab the last 1 order within the last 1 minute and cancel, but I could not figure that either… That seemed even more complicated)
Any help would be greatly appreciated

