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
25 1 1

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.

 

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?

 

Can anyone help with this?

Replies 2 (2)

OrionLee
Excursionist
25 1 1

For extra info, old one used to have this code in liquid. 

 

<div id="variant-inventory" class="{% unless current_variant.available %} hide {% endunless %}">
{% if current_variant.inventory_management == "shopify" and current_variant.inventory_quantity > 0 %}
We have your item in stock. It will be shipped in 7 working days.
{% else %}
{% if current_variant.inventory_quantity <= 0 and product.available %}
Not in stock, but we will order this in for you if we can {% endif %}
{% endif %}
</div>

 

 

The new theme is json.

 

 

 

Zel_Minimate
Shopify Partner
59 0 4

There is another way to show a message like "It will be shipped in 7 working days" on the product page without any code using the Hey! Scarcity Low Stock Counter app. This app includes a specific feature that allows you to display custom messages on the product page for items that have the "Continue selling when out of stock" option enabled. If anyone is looking for an alternative method, they can try this app here.

All the best,

MINIMATE APPS - CUSTOMIZATION & SCARCITY MADE SIMPLE!
Mini Customization Fields: Effortlessly create and manage custom product fields for a personalized product options.
Mini: Coming Soon | Waitlist : Maximize revenue through waitlists and pre-orders.
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