Changing the "in stock qty" to display "Available to order" if quantity reaches 0 or below

3PConsumables
Visitor
2 0 0

I want to make all my products available to order if they are not in stock, I understand that to do this i need to select the continue selling checkbox on each product page.

 

However, I am currently using a different page template for products that are only available to order so that I can have the products display "Available to order" at the top. Is there a way to have the product display the qty in stock if the stock level is above 0, but if the stock falls to 0, then still allow the customer to purchase, but have some text that appears saying that these are available to order?

 

I am using the Empire theme

 

Thank you in advance!

Replies 3 (3)

StephensWorld
Shopify Expert
1377 167 342

That should be doable with custom coding. Something like this:

 

 

{% if variant.inventory_quantity > 0 %}
  <p>{{ variant.inventory_quantity }} in stock.</p>
{% else %}
  <p>Available to order!</p>
{% endif %}

 

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca

3PConsumables
Visitor
2 0 0

Thank you for your quick answer. Sorry to probably ask a really basic question, but where about would I need to put this code?

StephensWorld
Shopify Expert
1377 167 342

You'd need to replace the coding in your theme with the code that I shared. If you're unfamiliar with making coding edits, you'd want to hire a Shopify Partner/Expert to make the changes for you. 

 

You can hire someone from this page (https://www.shopify.com/partners/directory/services/store-setup/customize-theme). I'd also be happy to quote you for this work -- you can find my contact details in the signature of this post. 

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca