Hi, i'm trying to customize standard automation of shopify flow to hide out of stock products.
I need to autohide not all products but only the ones that are out of stock after over 90 days, so customers can eventually preorder meanwhile the products is restocked.
I think that a variabile that i can consider is updated_at, but i don't know how to use it.
Can you help me?
Shopify doesn't store the dates when a product or variant goes out of stock. You could do that by setting a product metafield (you would need to define that metafield first through the Admin, something like a out_of_stock_date). The problem after that is that you cannot yet query by metafields. So you might need to use tags instead (which you can use in a query), setting it to something like "nostock_02_28_24"). Then you can use a "Get product data" query to get products that were expired 90 days ago (using tag:nostock_12_28_23). You'll need to write some liquid to get the write tag/date.
Dive into the world of Print-on-Demand and discover how it can transform your online busin...By Imogen Feb 19, 2024
Discover how to transform your online store into a delightful shopping destination. Learn ...By Ollie Feb 13, 2024