Estimated Delivery Time based on stock status

New Member
8 0 0

This is my code I have now:

 

 <div class="in-stock">
              <p>Beschikbaar: <span class="stock">{% if product.available %}Op Voorraad</span>
{% else %}<span class="out-of-stock">Niet op voorraad
{% endif %}</span></p> </div>

The problem with this is as followed:

 

When products hit stocklevel 0 the stock status will change to "Not in stock" IF products are not available to order for customers. 

 

What I need:

 

When products hit stock level 0, the stock status needs to change in something like "Delivered in 1-3 days" but still be available to order for customers. Right now it will show: "In Stock".

 

 

Could anybody help me with how to code this? I have HTML/CSS and PHP knowledge but this is the first time setting up something in Shopify.. 

 

 

 

EDIT:

 

Never mind. With some coding experience it is very easy to add this. For people who are looking for the same feature, this is the code I used:

 

Beschikbaar: <span class="stock">{% if current_variant.inventory_quantity > 0 and current_variant.available %}Op Voorraad</span>
{% elsif current_variant.inventory_quantity == 0 and current_variant.available %}<span class="out-of-stock">Geleverd in 1-3 dagen</span>
{% else %}<span class="out-of-stock">Niet op voorraad</span>{% endif %}
0 Likes