Entering a custom message on inventory display when stock is at zero

Hi

For many of our products, if they go to zero stock, we can still get them, but it would be nice to let customers know there is a delay and we’re ordering them in.

I used to have a little but of custom code which did this, I think I added it to the product.liquid page. Any idea what I can use.

Ideally I want it to say ‘not in stock but we can order this in for you’ and I’d only want it to work on the products which had the ‘continue selling when out of stock’ button ticked?

Can anyone help with this?

For extra info, old one used to have this code in liquid.

{% if current_variant.inventory_management == "shopify" and current_variant.inventory_quantity > 0 %} We have your item in stock. It will be shipped in 7 working days. {% else %} {% if current_variant.inventory_quantity <= 0 and product.available %} Not in stock, but we will order this in for you if we can {% endif %} {% endif %}

The new theme is json.