How do I Show inventory quantities on product pages using Debut theme?

Tourist
3 0 1

Thanks, MarcoM!

I did have to switch the "out of stock" and "available" lines, but this works great! I changed the 3rd line to <5 so that it will tell my customers when something is low in stock.

0 Likes
New Member
3 0 0

Will it work with "Boundless" theme??

0 Likes
New Member
9 0 0

Hi all, I'm trying to acheive this as well, but it seems that Shopify's Show inventory quantities on product pages tutorial from the original post is gone. That same link redirects me to Managing your inventory — which is not what I want to learn.

It also means that I can't follow fellow commentor's solutions, since I don't know the first few steps. Please help, thanks!

0 Likes
Shopify Partner
2536 31 563

Peony,

check this thread: https://ecommerce.shopify.com/c/ecommerce-design/t/display-variant-inventory-quantity-on-product-pag...

The code there is pretty much complete, and it will work even if your shop is newer.

Want to hire me to tweak a theme? Mail me at tairli@yahoo.com! My post solved your problem? This is my Paypal too :)
0 Likes
New Member
9 0 0

Hi Tim, thanks for the reply! I tried following what Royce did and your instructions in that post, but I don't have the theme.js.liquid file. Mine is theme.js, so I wasn't able to locate some of the codes I had to replace.

I tried following whatever I could, you can see the result here. I too have the problem where it shows "out of stock" as default, and still no quantity.

0 Likes
New Member
3 0 0

Hi,

I'm trying to do this but when I try pasting in the code into line 111 it does nothing and my items still show 'Add To Cart' with no quantity. 

I'm using the Debut theme and what I would ideally like is to show quantities if it is less than 10 and not default to Out of Stock on variants, could someone please help me with this I'd be very grateful!

Thanks,

Jo

0 Likes
Tourist
10 0 2
<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>

I can't figure out how to get this snippet to display like:

Stock >  20 Display X
Stock < 20 Display Y
Stock = 0 Display Z

Basically I want to show another text when the stock level is low.

But can't figure out how to. Someone knows?

0 Likes
Highlighted
Tourist
10 0 2

Oh got it working :)

<div class="variant-inventory">
 {% if product.variants.first.inventory_management == "shopify" %}
    {% if product.variants.first.inventory_quantity > 9 %}
  <span class="stock-plenty">Vi har {{ product.variants.first.inventory_quantity }} i lager.</span>
    {% else %}
      {% if product.variants.first.inventory_quantity > 0 %}
       <span class="stock-few">Bara {{ product.variants.first.inventory_quantity }} kvar i lager - beställ snart.</span>
    {% else %}
  <span class="stock-out">Slutsåld</span>
    {% endif %}   
    {% endif %}
 {% else %}
    <span class="stock-ok">Finns i lager</span>
 {% endif %}
</div>

 

0 Likes
New Member
1 0 0

Tried adding the code at line 111 in product-template.liquid, save, and...nothing. No visible change on my product pages. I do not have variants, just one-off products. Any ideas? Thanks!

0 Likes
New Member
3 0 0

Bump please, still no idea why this isn't showing for me or James on Debut - please help!

0 Likes