Shopify themes, liquid, logos, and UX
I'm trying to display a message on my product page that says, "Available on backorder" for items that have "Continue selling when out of stock" is checked in admin, and inventory is equal to or less than 0. I'm using the Debut theme.
I got it to work by adding the following code to the product-template.liquid file:
<div class="productStatus">
{% if current_variant.available and current_variant.inventory_quantity > 0 %}
<span class="statusAvailable">Available</span>
{% endif %}
{% if current_variant.available and current_variant.inventory_quantity <= 0 %}
<span class="statusBackorder">Available on backorder. Please allow 2-3 weeks for delivery</span>
{% endif %}
</div>
hey in what part of the code did you enter this in.
Where did you enter this in the code?
You can enter this code wherever you want it to display on your product page. I placed it just below the product name as shown here.
<div class="productStatus">
{% if current_variant.available and current_variant.inventory_quantity > 0 %}
<span class="statusAvailable">Available</span>
{% endif %}
{% if current_variant.available and current_variant.inventory_quantity <= 0 %}
<span class="statusBackorder">Available on backorder. Please allow 2-3 weeks for delivery</span>
{% endif %}
</div>
it works with products which dont have variants. For variants products it do not update the text
Do you know if this could be done in the new theme of Shopify? I believe it is called "Dawn", or something like that
Is there a way to get this to work with variants?
Hope someone will find it helpful.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024