Shopify How to Display Stock Quantity on low stock products
I did something like
{% for variant in product.variants %}
{% if variant == product.selected_or_first_available_variant %}
{% assign stocklevel = variant.inventory_quantity %}
{% if stocklevel < 10 %}
{% variant.inventory_quantity%}
{% endif %}
{% endif %}
{% endfor %}
but it only displayed the first variant value
I