The overall goal is to show a badge on every product listing like “restocking soon” if the product has inventory.incoming > 0 (e.g. a purchase order has been created and the product has incoming stock on it’s way).
I don’t want to use a 3rd party app for this, and I want to avoid modifying liquid directly in my templates (today I do this, and am I trying to avoid it moving forward…).
Today, I modify my prestige template theme (product-badges.liquid) to have an extra piece of code:
{% if variant.available == false and variant.incoming %}
Restocking soon
{% endif %}
I want to avoid that custom code in the template. I use prestige theme and it has a feature where every product has a metafield called “badges”. Any text you put into that metafield will show up on the product listing as a badge (so this is essentially a way of adding custom badges to a product in addition to the defaults like “sold out” etc).
I am hoping that there is some automated way (e.g. via Flow) to make it so that whenever a product’s “variant.incoming” value is > 0 , the badges metafield on that product is updated to say “Restocking soon”.
Can flow do this? either by acting on product update or purchase order creation?
Thanks.
