Output message when all variants are available

Hi,

I would like to show a short message above the add to cart, when all variants of a product are available. As customers can preorder products, my definition of available is that the stock is > 0.

I tried achieving this using the following:

{% assign available_message = false %}
{% for variant in product.variants %}
{% if variant.inventory_quantity > 0 %}
{% assign available_message = true %}
{% endif %}
{% endfor %}

{% if available_message == true and request.locale.iso_code == ‘es’ %}

Disponible para entrega inmediata: En 1-2 días en su domicilio.

{% elsif available_message == true and request.locale.iso_code == 'de' %}

Sofort lieferbar: In 1-2 Tagen bei dir zuhause.

{% endif %}

However, this message keeps showing even if some variants have a stock of below 0.

Any help is much appreciated.

We are using the prestige 2.0 theme.