How can I add an in-stock tag on product pictures using the Empire theme?

Ferhat6
Visitor
2 0 0

I am using emire theme. I want to have the in stock label on the pictures of the products in stock, but I couldn't do it. how can I do this?

Replies 3 (3)

kaiyaa
Excursionist
182 13 19

Hello @Ferhat6 

you can add this code in theme file where you want to show in product page. 

  <div id="variant-inventory" class="{% unless current_variant.available %} hide {% endunless %}">
{% if current_variant.inventory_management == "shopify" and current_variant.inventory_policy != "continue" %}
{% if current_variant.inventory_quantity > 0 %}In stock{% endif %}
 {% endif %}
</div>


If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
 

Was I helpful? Buy me a coffee
For fast response Message me
Need Help Message me
Ferhat6
Visitor
2 0 0

Hello, thank you for your help. However, in which file will this code be placed in the edit code?

kaiyaa
Excursionist
182 13 19

Can you please share your store link and theme name.

Was I helpful? Buy me a coffee
For fast response Message me
Need Help Message me