Display stock level for product variants

Highlighted
New Member
6 0 0

Hi,

 

I'm looking for a way to display in stock variants for my products. For example something I found here (https://imgur.com/GV0i0iJ) on another website. I'm using the Debut theme.

 

I've looked at other threads but most people keep running into the same problem, which is that the stock level doesn't change when switching variants, unless you refresh the page.

 

Help would be very appreciated.

Kind Regards,

Jam

0 Likes
Shopify Staff
Shopify Staff
33 0 4

Hi Jam!

Before we change anything, let's go to Online Store > Actions > Duplicate
Because it's always good to have a backup!
In order to enable the inventory tracking option, go to Online Store > Actions > Edit Code and select the product-template.liquid. Scroll to line 111 and paste the following code:

        {% if section.settings.show_vendor %}
          <p itemprop="brand" class="product-single__vendor">{{ product.vendor }}</p>
        {% endif %}
           {% 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" %}
              Only {{ current_variant.inventory_quantity }} left!
              {% 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." 
This is also something that our theme team could handle for you! Just let me know if you'd like me to write up a design ticket for you and we can take our interaction over email :)

I took a sneak peak at your website and I thought I'd send over a couple of awesome blog posts to help get you on your way!

I would love to know more about your business and what marketing strategies you already have planned! Until then, I hope this helps!

0 Likes
New Member
6 0 0

Hi Parker,

 

Thank you for your quick response. This is indeed what I'm looking for, but unfortunately as I've seen on other discussions aswell, is that the text doesnt change when selecting other variants (with different stock levels). Unless you refresh the page.. 

 

Anyone who has a solution for this?

 

0 Likes
Shopify Staff
Shopify Staff
33 0 4

Hi Jam!

I just spoke with a member of the theme team, and they mentioned that this particular change can vary quite a bit depending on the theme and version so thats why theres no all in one tutorial posted. Making the change also requires going into theme.js and adjusting existing code. That file can't be rolled back so we don't encourage merchants going in and making their own changes.

That being said, I was told that they can make this change for you! Just let me know if you'd like me to go ahead and create a design ticket for you so we can get this on the go for you :)

Looking forward to hearing from you!

0 Likes
New Member
6 0 0

Hi Parker,

 

Thank you for the quick response. I'm not that good with editing code, so that would be very helpful! Would this 'design ticket' be free of charge, or are there any additional costs involved?

 

Also, what way would they like to contact me? Email, phone or text? Let me know and I can provide my information if necesarry :)

 

Looking forward to hearing from you.

 

Jamiro

0 Likes
Shopify Staff
Shopify Staff
33 0 4

Hi Jam,

I've followed up with you via email to start the process to getting your theme updated!
For those who are unaware, check out some details about our theme support here.

I look forward to speaking with you over email, Jam :)

0 Likes