Hello guys,
I’ve been banging my head against the wall trying to figure this one out, hopefully someone has some idea of what is going on.
Basically, on one of our client sites we have code that does the following:
-
When a product variant is in stock, it displays a message saying product is in stock
-
When the variant is out of stock, it displays a message saying out of stock
The code seems to work great, UNTIL one variant has 10 units of inventory or higher. Then the code displays as out of stock even though there is clearly inventory in stock.
Once the variant inventory is reduced to between 1-9, the message displays correctly that it is in stock.
Does anyone have any ideas why this could be happening?
Here is the code we’re using:
{%- if product.selected_or_first_available_variant.available == false -%}
{%- else -%}
{%- endif -%}
And in the CSS:
.show{display:block !important;}
.hide{display:none !important;}
I have tried a bunch of different things and none of them seemed to work.
Any suggestions would be greatly appreciated.
Thank you!