Hello,
I’m having a recurring problem with displaying an “in stock” or “out of stock” message for one of our stores.
Here is the code:
{%- if product.selected_or_first_available_variant.available == false -%}
{%- else -%}
{%- endif -%}
The variable product.selected_or_first_available_variant.available seems to be showing as FALSE (ie. there is no product variant available for sale) when the inventory for the variant is above 9 (or double digits). So that when there is inventory for a specific variant, it shows the “3-4 week lead time” message (out of stock) instead of showing in stock.
As soon as the inventory is decreased to a quantity of 9 or lower, the in stock message shows properly.
Does anyone know why this is happening?
Thanks in advance!