Liquid, JavaScript, themes, sales channels
Hi everyone. I am wanting to add a "low in stock" label to products which have less than 2 items left in stock. Same as when a product is sold out it has the "sold out" label underneath the image of the product in collections. Does anyone know how I can put that "low in stock" label for my products? Thanks!
Solved! Go to the solution
This is an accepted solution.
You can add in product-thumbnail.liquid file.
Cheers,
Tejas
You can use the following code:
{% if product.first_available_variant.inventory_quantity < 2 %}<div>low in stock</div>{% endif %}
Thank you,
Tejas
Hi @Tejas_Nadpara, thanks for replying! Where do I put that code? In the product snippet?
It depends on theme. Which theme you are using?
Thank you,
Tejas
This is an accepted solution.
You can add in product-thumbnail.liquid file.
Cheers,
Tejas
Hello,
Sorry to gatecrash the thread - would this work on the Brooklyn theme, and if so where would i put the code please?
Thanks in advance.
Simon
Yes, It will work on the Brooklyn theme as well.
Send me an email with your store URL, I will help you to put it on correct place.
Thank you,
Tejas
That's great - thanks so much for your very kind help.
clairabow.co.uk
Simon
Does anyone know where to put this snipped in the Palo Alto theme? Thanks!
Hi, sorry to message out of the blue but I am trying to do this in the Pipeline theme, however I cannot find a product-thumbnail.liquid file. Would you be able to please help point me in the right direction? My email is jdj.hall@gmail.com
Does this work in the Dawn theme? And where can I add it?
If you need these labels in the literal images so they work multichannel modemagic can edit images automatically https://apps.shopify.com/modemagic
Save time & money ,Ask Questions The Smart Way
Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Buy Paul a ☕ Coffee for more answers or donate to eff.org
@Tejas_Nadpara Does this work on Debut theme? I've been scouring for answers for so long.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024