Need to show remaining inventory..

Highlighted
New Member
2 0 1

Currently using the Simple theme and would love to show remaining inventory on my product pages (as this is info that my customers base their purchases on from time to time).

I’m a novice so if someone could paste me a code and tell me where to stick it (hey now ) I would greatly appreciate it. I tried the following code per another post’s recommendation and it didn’t work..

 

{% comment %} Inventory tracking on product page {% endcomment %}
            <div id="variant-inventory" class="{% unless current_variant.available %} hide {% endunless %}">
              {% if current_variant.inventory_management == "shopify" and current_variant.inventory_policy != "continue" %}
              We have {{ current_variant.inventory_quantity }} in stock.
              {% else %}
              This product is available.
              {% endif %}
            </div>

 

1 Like
Highlighted
Shopify Partner
77 8 19

Hi Harleydee,

 

I should be able to give you a hand with this, it would be much easier if I could have a look at your theme code and let you know exactly where to add it in, or I can even do it for you if you like. 

If you let me know your shop URL I can request temporary access and give you a hand with it.

 

Josh

Joshua Sarros - Freelance Web Developer from Melbourne, Australia
joshuasarros@gmail.com
0 Likes
Highlighted
Shopify Partner
1593 347 465

Hey @Harleydee,

Try with following

<div id="variant-inventory">
{% if product.variants.first.inventory_management == "shopify" and product.variants.first.inventory_quantity > 0 %}
We currently have {{ product.variants.first.inventory_quantity }} in stock.
{% endif %}
</div>

 

Let me know if this works.

Thanks! 

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
1 Like
Highlighted
New Member
2 0 1

that didn’t work so it’s obviously user error here. I sated it in product-template.liquid around line 113.. after product price. 

0 Likes
Highlighted
Shopify Partner
1593 347 465

Hey @Harleydee,

What error you have?

Please let me know.

Thanks!

If helpful then please Like and Accept Solution.
Do you need custom changes on store ? Hire me.
Feel free to Contact me on dmw.webartisan@gmail.com
Follow us on Instagram @dmw.webartisan
0 Likes