Entering a custom message on inventory display when stock is at zero

Entering a custom message on inventory display when stock is at zero

OrionLee
Excursionist
24 1 0

Hi

 

For many of our products, if they go to zero stock, we can still get them, but it would be nice to let customers know there is a delay and we're ordering them in, rather than them thinking an items is in stock.

 

I used to have a little but of custom code which did this, I think I added it to the product.liquid page.  Any idea what I can use.

 

Ideally I want it to say 'not in stock but we can order this in for you' and I'd only want it to work on the products which had the 'continue selling when out of stock' button ticked?  Or simply showing that it's not in stock, but still orderable?

 

Can anyone help with this?

Replies 18 (18)

saim007
Shopify Partner
550 70 93

Hi @OrionLee ,

 

You have to just copy and paste this code in your product.liquid file or whatever product-template.liquid file 

{% unless product.available %}
  <p style="color: #000; background-color: darkseagreen; padding: 5px; border-radius: 5px; border: 1px solid #000; font-weight: 600;">Not in stock but we can order this in for you</p>
{% endunless %}

Your custom message will show when inventory is 0.

 

Please let me know if works and mark as solve! 

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Thanks I will give this a go, I think my them is in JSON though, rather than liquid. I assume that might make a difference? My previous theme was liquid.

saim007
Shopify Partner
550 70 93

@OrionLee There will be a liquid file in the section or snippet in sidebar of Shopify coding. there you can find and paste above code.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Does it have to go into product.liquid?

There's no product.liquid in either snippets or sections for some reason

 

OrionLee_0-1681295150657.png

 

saim007
Shopify Partner
550 70 93

@OrionLee Paste the code in the product-variant-options.liquid file it will show text above the variant options.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Hmm

 

Not sure if I have put it in the right place 

OrionLee_0-1681296127150.png

 

 

Example of item it should be showing on https://shop.girlguidingnwe.org.uk/products/leaders-trefoil-woven-badge

saim007
Shopify Partner
550 70 93

Do you have Product info template or main product template if you found then please find for this class code product__tax caption rte if you found this class then just put above under this class name.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Like this?

 

OrionLee_0-1681300418747.png

 

saim007
Shopify Partner
550 70 93

That's great! You are too close. just paste the code above this line that's it!

{%- if shop.taxes_included or shop.shipping_policy.body != blank -%}

 Now I hope it will definitely work!

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

I don't think it has worked 😞

OrionLee_0-1681302500493.png

 

saim007
Shopify Partner
550 70 93

@OrionLee You didn't place the code above the {%- if shop.taxes line just place above it. and check it will work.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Apologies!

Still not sure it's worked though 

OrionLee_0-1681304916618.png

 

saim007
Shopify Partner
550 70 93

@OrionLee Perfect, now you can create any test product and add inventory 0 and check it will show your custom text.

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

Hmm 

I already have a  number of items like this - for example https://shop.girlguidingnwe.org.uk/products/guides-trefoil-woven-badge

But it's not showing,

 

saim007
Shopify Partner
550 70 93

I checked your example link but there is showing Add to Cart button that means this product have inventory. If product have zero inventory then button should show Sold Out instead of Add to Cart, that means you doing something wrong. 

Saim | Shopify Partner Expert

Was I helpful?

Buy me a Coffee

🙂
Hire me   to unlock the full potential of your e-commerce store 🙂
OrionLee
Excursionist
24 1 0

It has potential inventory - I can order it from our supplier.  I don't want to prevent people from being able to buy the item.  I just want them to know we don't have it physically in stock at the time it's purchased.

Tufan_Minimate
Shopify Partner
33 0 1

Hi @OrionLee ,


If you're still looking for help, I'd like to offer an alternative solution. Hey! Scarcity Low Stock Counter app includes a feature specifically designed for this purpose. It allows you to display custom messages on the product page for items that have the "Continue selling when out of stock" option enabled. You can easily set it up to show a message like "Not in stock but we can order this in for you" whenever a product goes out of stock but is still available for order.


This way, your customers will be aware of the delay and won't be misled into thinking the item is currently in stock. Here is the link to the app if you want to explore it.


If you're interested, I'd be happy to help you get this feature set up. Feel free to reach out for more details!


Best regards,
Tufan 

MINIMATE APPS - CUSTOMIZATION & SCARCITY MADE SIMPLE!
Mini Customization Fields: Effortlessly create and manage custom product fields for a personalized product options.
Hey! Scarcity Low Stock Counter: Boost sales by displaying low stock message to create a sense of urgency.
Explore Our Apps for Free | 24/7 Dedicated Support for Shopify merchants

Dirk
Shopify Staff
2395 255 524

Hey, @OrionLee 

You have the option to input a personalized message that will appear when your product's stock reaches zero. 

To set this up, head over to your Shopify admin dashboard and navigate to the "Products" section. Choose the specific product you want to modify and scroll down to the "Inventory" segment. Under "Inventory policy," opt for "Shopify tracks this product's inventory" and ensure that the "Continue selling when out of stock" box is checked. 

In the "Out of stock message" field, you can craft your custom message. If you're looking for more advanced features, consider exploring Shopify apps like "Back in Stock" or "Stockify" for additional inventory management capabilities and tailored messaging options.

 

If there is anything else I can help you with, please let me know.

 



 

Dirk | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog