To continue receiving payouts, you need to secure your account by turning on two-step authentication. If two-step authentication is not turned on your payouts will be paused. Learn more

Custom message when there is 0 items in stock [Supply theme]

Solved
adios
Tourist
14 0 2

Hello,

 

I am using Supply theme and if there are some items (variants of items) in stock the message says "Only X items left!" (standard theme feature).

What I wanted to have is custom message when there is 0 items in stock.

 

For example:

There are 5 items (variants of items) in stock so message says:

"Only 5 items left!" (as it is now)

 

There is 0 items in stock so message would say:

"Item available from a supplier. Allow 2-3 weeks to deliver"

 

Here is a code for standard "only x items left" feature inserted.

 

  {% if section.settings.product_quantity_message%}
          <div id="variantQuantity-{{ section.id }}" class="variant-quantity {% if variant.inventory_management and variant.inventory_quantity < 10 and variant.inventory_quantity > 0 %} is-visible{% endif %}">
              {% include 'svg-definitions' with 'stock-icon' %}
              {% if variant.inventory_management and variant.inventory_quantity < 10 and variant.inventory_quantity > 0 %}
                {% assign qty = variant.inventory_quantity %}
                <span id="variantQuantity-{{ section.id }}__message">{{ 'products.product.only_left' | t: count: qty }}</span>
              {% endif %}
          </div>

 

Could please anyone help?

 

Thank you.

 

Regards

 

Replies 25 (25)
fetchcartca
New Member
1 0 0

I would like to show a message like "Currently out of stock, ETA is 2-3 Weeks" with active add to cart button. 
One product for example (stock is zero with active add to cart button):

 

Product URL 

I am using warehouse theme...

 

Thanks in advance

 

perkullekul
New Member
1 0 0
hi Ninthony.
your code did not work on my website.
there is this code in my theme.js.liquid files :
 
if (variant && variant.inventory_management === 'shopify') {
  showInventory = true;
  quantity = window.inventories[this.sectionId][variant.id];
 
  if (quantity <= 0 || quantity > 10) {
showInventory = false;
  }
}
 
it doesn't start like your code :
 
if (variant.inventory_management) {}
 
 
if the product is 0 in stock. then continue with pre-order. not with sold out.
and I don't know what file to change.
 
thanks.
AlTaqniastore
New Member
1 0 0

Hi ,

 

I am also looking for this solution.

 

If the product quantity is 0 and ( Continue selling when out of stock ) is enabled, then I would like to show a message on the product page as 

2 - 3 weeks delivery.

 

If the product quantity is 0 and ( Continue selling when out of stock ) is disabled, then i would like to show a message on the product page as

Contact us for price and future availability.

 

If the product quantity is not 0 and ( Continue selling when out of stock ) is enabled or disabled, then I would like to show a message on the product page as 

Free Delivery - 2 working days.

 

Above requirement is for all the products on my website.

 

@Ninthony  can you please assist.

Jasperfoller
New Member
9 0 0

Hi Brian, i would also like to have a custom message that pops up when people are buying an item out of stock. I would like it to say "Available on backorder. Please allow 2-3 weeks for delivery" Is this possible?

OptiAcc
New Member
1 0 0

Hi

Can you help me fix my site for stock status messages. 

I would like to have following messages:

In Stock  - Ships today.

Out of Stock  - Ships in 4 days.

 

Regards

JasonA
New Member
1 0 0

I’m actually having the same issue. I have an online parts store and currently everything is showing in stock. Customers are placing orders and are expecting the items right away. It is frustrating given that I spend most of my time reply back to very upset customers. I am looking for something where this headache will go away. The messaging is perfect and would love something like this. My only issue is that depending on the product lead times are different. Something may take up to 3 to 4 weeks while somethings 3 to 4 days. Any help would be great.