Showing Inventory quantity on products venture

dreamstodecor
Tourist
9 0 3

How do I show on my product pages when I have a limited amount in quantity. I had installed Hotjar just to test out what my customers are doing and one was trying to add more of 1 item but had to pick other items. So I want to be able to show, say this item has only 4 in stock instead of the customer receiving a message saying no other stock available or something like that.

Replies 6 (6)
KetanKumar
Shopify Partner
24919 2497 9033

@dreamstodecor 

Thanks for post

can you please try this 

<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>
If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
dreamstodecor
Tourist
9 0 3

Would I place this in the product.liquid code?

KetanKumar
Shopify Partner
24919 2497 9033

@dreamstodecor 

Thanks 

yes, product.liquid code add above add to cart button or product name

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
BaySchoolArts
New Member
2 0 1

Thank you, this worked for me! I appreciate you sharing your knowledge.

KetanKumar
Shopify Partner
24919 2497 9033

@BaySchoolArts 

it's my pleasure to help us

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
UnspokenBeta
New Member
1 0 0

Hi there, 

 

I've implemented the code you provided, and the quantity shows up, but only for the first variant. Unfortunately, the quantity does not change when changing the variants like size and color. Refreshing the page does not help. 

 

Is there a way to make it adjust automatically to the variants selected on each product page? 

 

Or would it be easier instead to just have a dropdown to select quantity for each variant available?

 

Many thanks.