How to Show a Message Above the Buy Button on Shopify if an Item is on Backorder

Amanda asks:

I want to show on the front end that if an item has 0 inventory, you can still purchase it, but a message appears above the Buy button “Item is on backorder and may take up to 2 weeks to fulfil”

Here is a Shopify Liquid snippet that will show a message above the Buy button if an item has 0 inventory and can still be purchased, but will take up to 2 weeks to fulfill:

{% if product.available and product.inventoryQuantity == 0 %}
  <p>Item is on backorder and may take up to 2 weeks to fulfill</p>
{% endif %}

This code uses the product object, which is available on product pages and is used to access information about the product being viewed. The available property checks if the product is available for purchase, and the inventoryQuantity property checks the current inventory level. If the product is available and the inventory level is 0, the message will be displayed.

Please note that you will need to place this code snippet in the appropriate location of your theme file(s) where you want to show this message on front-end.

Additionally, you might also want to make sure that your product inventory tracking is enabled from shopify admin settings and products are properly set as available for purchase even when the inventory is 0.

Also, you can replace the “2 weeks” with any time frame you want to indicate to the customer.

Please let me know if you need further assistance.

Keep in mind that this is just a basic example, and you might want to adjust it depending on your specific needs and the requirements of your store.