Display Inventory Quantity on the Product Page

Highlighted
New Member
1 0 0

I am trying to show inventory quantities on the product page. I'm using the Icon Dolce Theme. is this an easy fix? I have no experience with liquid or modifying Shopify themes.

0 Likes
Highlighted
Excursionist
92 0 14

Hi Brad,

let you know how to add that inventory show on product detail:

In order to enable the inventory tracking option, navigate to your HTML/CSS editor and select the product-template.liquid. Scroll to line 111 and paste the following code:

   {% 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>

If your product does not have inventory tracking enabled, it will simply read as, "This product is available." 

 

If you have any more query or help then you can sent mail me at jaygandhi0692@gmail.com

shoot mail if you need any help : jaygandhi0692@gmail.com
Highlighted
New Member
1 0 1

Hi,

I used that code on my shop to show inventory on a product page, but it is not working as I expected. The problem is when a product has variants, for example, if variant 1 has 10 items in stock and variant 2 has 8, it doesn`t update the quantity when I change from variant 1 to 2 (variant 2 is showing 10 instead of 8), only if I refresh the page. Is there a way to fix this?

Highlighted

For Display or Update inventory quantity on product page based on the variant, dropdown changed then we need to write custom javascript code in your theme files.

You can check at our client website we already did for them.

Client Website 1:
https://rheemprogear.com/products/metal-key-tag-w-bottle-opener


Client Website 2:
https://ruudprogear.com/collections/frontpage/products/triton-intelligent-tee

If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact us regarding any help, below our contact listed:
Shopify Expert Page: https://experts.shopify.com/brisk-developers
Email: support@briskdevelopers.com
Contact us: https://www.briskdevelopers.com/contact-us
Skype: briskdevelopers
Highlighted
New Member
2 0 1
Hi can I access HTML CCS editor on my mobile phone? If so, where do I find it? Thanks
0 Likes
Highlighted
Hi Yahirachimelove,

This feature is not default provide by shopify, you need to write custom code in your theme for display quantity based on dropdown value change and swatch change.
If helpful then please Like and Accept Solution. Want to modify or custom changes on store Hire me. Feel free to contact us regarding any help, below our contact listed:
Shopify Expert Page: https://experts.shopify.com/brisk-developers
Email: support@briskdevelopers.com
Contact us: https://www.briskdevelopers.com/contact-us
Skype: briskdevelopers
0 Likes
Highlighted
New Member
1 0 1

Hi, 

 

Im looking for Display Inventory Quantity on the Product Page solution. On my shopify store. 

Highlighted
New Member
3 0 0

Same here, also looking for a solution to this

0 Likes
Highlighted
Tourist
26 0 1

@You2sell @TVCS 

Add this code to your product-template.liquid file. I'm using the Simple theme, and it goes immediately after line 112 (after "<div class="product-single__policies rte">") and that works for me:

{% 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>

More details are here: https://community.shopify.com/c/Shopify-Design/How-do-I-Show-inventory-quantities-on-product-pages-u...

What I now want to do is show the inventory at the various locations. Anyone know how to do that?

Highlighted
New Member
1 0 0

This works on the Supply theme, but not in the Venture theme, can anyone tell me how to add this to the venture theme?

0 Likes