Hello, I have combed through the community but cannot find a solution for my problem. I have added the following code on line 131 in product.template.liquid :
{% if product.variants.first.inventory_management == "shopify" %}
{% if product.variants.first.inventory_quantity > 0 %}
Only {{ product.variants.first.inventory_quantity }} left in stock.
{% else %}
The product is out of stock
{% endif %}
{% else %}
This product is available
{% endif %}
{% endif %}
The issue is that it only shows the inventory for a single variant when there are multiple variants. I would like to show remaining stock for each variant when that variant is chosen. Please advise!!
This part needs to write more javascript. If you know the location of the code where the function click variant. You can share it here so people can help you.