What's your biggest current challenge? Have your say in Community Polls along the right column.

Use Shopify Flow to Tag orders with Backordered Items

Use Shopify Flow to Tag orders with Backordered Items

Kronos9326
Excursionist
16 1 0

Hi there. We have several products that we allow to go to backorder/preorder status within shopify and allow customers to place orders for those items.

 

Our fulfillment backend however makes finding these orders tedious when it comes to fulfillment. (We are using Cin7 Core). We would like to know if it's possible to tag an order that contains an item with a managed stock level of less than 0 with a) the SKU of the backordered item, or b) BACKORDERED as a tag.

This will allows us to find these orders quickly in the fulfillment system for processing and shipping. I'd prefer to stay with flow if possible and not use a 3rd party app.

Replies 3 (3)

Steve_L
Shopify Staff
11 2 3

Would something like this work? 

Steve_L_0-1697049980786.png

This option checks if the product associated with any line item on the order has a totalInventory less than or equal to 0, and if so, it adds a `BACKORDERED` tag to the order.

 

Another approach is to loop over the line items and check a similar condition. This way we can include the sku on the tag, like `BACKORDERED: {sku}`.

Steve_L_1-1697050158484.png

 

 

To learn more visit the Shopify Help Center or the Community Blog.

Kronos9326
Excursionist
16 1 0

Since the flow is run AFTER the order is placed, an order can accidentally be tagged with 'backorder' if the order got the last item in stock, since the logic of 'total inventory' being 0 or less is true.

Would using 'current QTY'  ( lineItemsForeachitem.currentQuantity -- The line item's quantity, minus the removed quantity.) be a better fit in this scenario?

 

Otherwise, this does work, with the exception of the aforementioned 'last item' order.

paul_n
Shopify Staff
1439 157 333

Quantity is the quantity ordered and not the in-stock quantity. I would just change the operator to less than 0, although this assumes that you allow the number to go negative.

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.