I’m using the feature on Dawn theme to display inventory. I only want the inventory count to show if the item stock is equal or less than a quantity of 10.
How would I go about doing this in the code? Can someone please assist with this?
Steps to Display Inventory Count Only When Stock is 10 or Less
Go to your Shopify Admin
Navigate to Online Store > Themes
Click on Customize for your active theme
Click on Edit Code
Find and open the file: main-product.liquid
Look for the existing inventory display code, usually within {% if product.variants.first.inventory_quantity > 0 %}
Replace or modify it with the following:
{% if current_variant.inventory_quantity <= 10 and current_variant.inventory_quantity > 0 %}
Hurry! Only {{ current_variant.inventory_quantity }} left in stock.
{% endif %}