How do I code between a quantity of numbers to show stock levels?

SilverBeach
Tourist
13 0 3

In a nutshell i'm trying to put a low in stock label on products where the inventory is under 5.

I managed this but it's also displaying 0 in stock as opposed to saying sold out badge.

I want it to display on products where the inventory is between 1 and 5.

 

This is the code i've used in product-grid-item.liquid file:

 

      {% if product.first_available_variant.inventory_quantity > 0 %}
      <div class="items-left">
          Left {{ product.first_available_variant.inventory_quantity }}
      </div>
      {% endif %}

 

Thanks

shop.JPG

 

Replies 0 (0)