Backorder Notification on Product page

Green2
New Member
3 0 0

Hello everyone!

I'm looking to add code to my product page (possibly product-form.liquid) that would allow us to show if an item is Backordered (stock < 1) or not. Our current theme, Turbo by Out of the Sandbox, supports displaying quantities, but not this. Basically, if an item's quantity is below 1, we hope to show a status that says "On Backorder - Can be Made to Order". We'd ideally like this to be across all our website products when "Continue selling when out of stock" is selected.

Basically something like:

{% if current_variant.inventory_quantity < 0 %}
On Backorder - Can be Made to Order
{% endif %}

I've tried many solutions from posts floating around, but either none display, or none seem to want to updated when another variant is selected. I'd also be curious to hear if anyone has managed to figure out anything to switch the "Add to Cart" button on these circumstances. I'll also mention I tried fiddling with the JSON to create {{ 'products.product.items_left_count.backorder' | t }}, but I can't figure out how I'd work it into the following code:

{% if product.available %}
{% if settings.display_inventory_left %}
<div class="items_left">
{% if variant.inventory_management != blank and variant.inventory_quantity > 0 %}
{% capture items_left_text %}
{% if variant.inventory_quantity == 1 %}
{{ 'products.product.items_left_count.one' | t }}
{% else %}
{{ 'products.product.items_left_count.other' | t }}
{% endif %}
{% endcapture %}
{% if variant.inventory_quantity <= settings.inventory_threshold %}
{{ variant.inventory_quantity }} {{ items_left_text }}
{% endif %}
{% endif %}
</div>
{% endif %}
{% endif %}

What might be the best way to do this at all? Thank you in advance!

0 Likes