Solved

Adding a "low in stock" label to a product image

Peppalane12
Tourist
11 0 1

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!

Accepted Solution (1)
Tejas_Nadpara
Shopify Partner
1118 222 552

This is an accepted solution.

@Peppalane12 

 

You can add in product-thumbnail.liquid file.

almost-soldout.png

 

Cheers,

Tejas

 

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on tejas.nadpara@gmail.com regarding any help

View solution in original post

Replies 14 (14)

Tejas_Nadpara
Shopify Partner
1118 222 552

@Peppalane12 

 

You can use the following code:

{% if product.first_available_variant.inventory_quantity < 2 %}<div>low in stock</div>{% endif %}

 

Thank you,

Tejas 

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on tejas.nadpara@gmail.com regarding any help
Peppalane12
Tourist
11 0 1

Hi @Tejas_Nadpara, thanks for replying! Where do I put that code? In the product snippet?

Tejas_Nadpara
Shopify Partner
1118 222 552

@Peppalane12 

 

It depends on theme. Which theme you are using?

 

Thank you,

Tejas

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on tejas.nadpara@gmail.com regarding any help
Peppalane12
Tourist
11 0 1

@Tejas_Nadpara I'm using Retina by Out of the Sandbox! 

Tejas_Nadpara
Shopify Partner
1118 222 552

This is an accepted solution.

@Peppalane12 

 

You can add in product-thumbnail.liquid file.

almost-soldout.png

 

Cheers,

Tejas

 

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on tejas.nadpara@gmail.com regarding any help
Simon_Brindle
New Member
6 0 0

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

Tejas_Nadpara
Shopify Partner
1118 222 552

@Simon_Brindle 

 

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

Shopify Expert | Skype: tejas.nadpara
- Like and Mark as an Accepted Solution if reply helpful
- Feel free to contact me on tejas.nadpara@gmail.com regarding any help
Simon_Brindle
New Member
6 0 0
That's great - thanks so much for your very kind help.

clairabow.co.uk

Simon

Simon_Brindle
New Member
6 0 0

@Tejas_Nadpara 

That's great - thanks so much for your very kind help.

clairabow.co.uk

Simon

KSVetiver
Visitor
3 0 0

Does anyone know where to put this snipped in the Palo Alto theme? Thanks!

lushbeautyshop
Visitor
2 0 0

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

Zoarvalleyvinyl
Visitor
1 0 0

Does this work in the Dawn theme? And where can I add it?

PaulNewton
Shopify Partner
6274 573 1319

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


foreverrosebear
Visitor
1 0 0