I’m using a custom liquid block on my product form with the below code. I want this to reveal itself when someone selects a size with less than 3 units left. It should hide when they select a different size that’s got higher than 3 units left. It seems to work inconsistently. Any ideas?
Note the size XS has 8 units and the 3XL and 4XL have 2 units each.
https://katharinalou.com/products/the-annabel-maxi-peach-plaid
####
{%- if product.selected_or_first_available_variant.inventory_quantity < 3 -%}
Less than 3 left!
{%- endif -%}
