Add In stock message Without An App

Highlighted
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.
0 Likes

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 %}
</div>
        
Want to modify or incorporate custom changes on store, Hire us.
If helpful then please Like and Accept Solution .
Email: pallavi@oscprofessionals.com
Skype : oscprofessionals-87
Custom Shopify Private App | Custom Theme Development | Custom Modifications In To Shopify Theme | Digital Marketing | Site Speed Optimization | Web Development
1 Like