Update inventory count on Order fulfillment

Update inventory count on Order fulfillment

CuziAye
Visitor
3 0 0

I currently am trying to find a way to edit the quantity of a product based off the quantity of another product.

So lets say when someone buys product A, its count will be reduced by 1, and it will also reduce the count of product B.

I know there are bundling apps that can sync the inventory counts for products that go together, but this is not an option that I can use since I have been having some other design problems with some bundling apps and I have many products that I cant transfer over to be a bundled product now.

So I have currently made a HTTP Request that reduces the inventory count of a product that I want which works, but the problem I am facing is the trigger.

I want the trigger to be when the product on the order becomes fulfilled, or if the inventory count for that particular product changes.
I can not use the "Product Variant Inventory Quantity Changed" trigger because it will just cause an infinite loop.

Would anyone know of a solution on how to get an accurate trigger for the change in a specific products. inventory.

Replies 2 (2)

PaulNewton
Shopify Partner
7721 678 1619

It's drastically saner to just use a scriptable third party automation app like usemechanic to build inventory sync management:

https://tasks.mechanic.dev/?q=sync

Shopify flow isn't meant for inventory syncing in it's current form, as you found  it's too easy to make infinite loops or race conditions.

And trying to get around that means the learning curve of trying to store state somewhere, like in metafields, and then all the problems that can come with that you will get wrong and sometimes not even know there's a problem all while trying to build that logic in flow's visual-paradigm instead of just coding it like an app.

Contact paull.newton+shopifyforum@gmail.com for the solutions you need


Save time & money ,Ask Questions The Smart Way


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Thank Paul with a Coffee for more answers or donate to eff.org


CuziAye
Visitor
3 0 0
I currently have a product A that has 3 variants which we'll call A1, A2, A3.

I have another product B that has 4 variants. The first variant is the product itself B0, the other 3 variants are including product A1,A2,A3 depending on if they click the respective variant for product B (E.g. B1= B+A1, B2 = B+A2, B3=B+A3)

The problem im facing is when the inventory count of B1,B2,B3 change, there is no way to sync that with Product A1, A2, A3.

Im unsure how mechanic can update the inventory of B0, A1, A2, A3 when product B1, B2, B3 is sold.
Is there documentation anywhere that shows how to sync variants in this specific way?

Thank you