Add In stock message Without An App

New Member
1 0 0
How can we add An Urgency like This
Only 5 left in stock or random number generated as stock number without the scamey ones that used by every app. Just a text. Like Amazon when u are adding to cart they show this message. Do anyone who now coding can help. By inventing a code that can show how much left in stock Only Text which fits all the themes.

Hello ,

Please add this code in product-template.liquid file..

<div id="variant-inventory">
 {% if product.variants.first.inventory_management == "shopify" %}
    {% if product.variants.first.inventory_quantity > 0 %}
       We currently have {{ product.variants.first.inventory_quantity }} in stock.
    {% else %}
       The product is out of stock
    {% endif %}
 {% else %}
    This product is available
 {% endif %}
Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Skype : oscprofessionals-87
Free Review and advice for sale on store | Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | SEO & Digital Marketing | Site Speed Optimization | Performance Site Audit