Show quantity on product page on Star theme?

vintagemaya
New Member
1 0 1

Hey!

I sell items if very limited quantities, sometimes only one or two. How do I show " Only 1 in Stock" or "Only 2 in Stock" on the product page right above the Add to Cart Button? I am using the Star theme.  

Thanks! 
Maya

g33kgirl
Shopify Partner
270 73 87

You can follow the tutorial here: https://shopifydeveloper.com/show-inventory-quantities-on-product-pages/

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
0 Likes
dmwwebartisan
Shopify Partner
6586 1536 2003

@vintagemaya 

Editing your theme code to add this feature.

In the Section directory, find the product-template.liquid file or which file responsible for product template, and add the following code where you want to show the QAUNTITY, in this example we’ve added this after the product title:

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

Hope this works.
Thanks!

 

If helpful then please Like and Accept Solution | Email: dmw.webartisan@gmail.com | Instagram: @dmw.webartisan
Check here PageFly App to customize your pages | Bag is a cart drawer that maximizes your sales. View app →
0 Likes
suyash1
Shopify Partner
2885 308 476

@vintagemaya - are you familiar with liquid code editing? if yes then you can do it , if no then I recommend to add one of us as staff and we can do it. If you want you can  contact me on email given below.

You are welcome to contact me, my email - suyash.patankar@gmail.com
Free Shopify solutions/tutorials on youtube
#1 page builder app on Shopify - for FREE! PageFly
0 Likes