Only show inventory when stock is below 10 - Dawn theme

Topic summary

A user wants to modify their Dawn theme product page to display inventory levels only when stock falls to 10 units or below, rather than showing it at all times.

Current situation:

  • The user provided their existing Liquid code for the inventory display section
  • They’re looking for a code modification to implement this conditional visibility

Proposed solution:

  • Another user suggested using the built-in theme customizer settings instead of code modifications
  • Navigate to: Customize > Product > Default product > Inventory status
  • The theme appears to have native settings that may control when inventory displays

Status: The discussion remains open—it’s unclear if the suggested customizer approach fully addresses the “only show below 10” requirement, or if additional code changes are still needed.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi there,

on my product page, I’d like the stock level to only show when the stock is 10 or less, what can I add to below code to achieve this?

Website

password: waiheke

{%- when 'inventory' -%}
                

                  {%- if product.selected_or_first_available_variant.inventory_management == 'shopify' -%}
                    {%- if product.selected_or_first_available_variant.inventory_quantity > 0 -%}
                      {%- if product.selected_or_first_available_variant.inventory_quantity
                          <= block.settings.inventory_threshold
                      -%}
                        
                          {{- 'icon-inventory-status.svg' | inline_asset_content -}}
                        
                        {%- if block.settings.show_inventory_quantity -%}
                          {{-
                            'products.product.inventory_low_stock_show_count'
                            | t: quantity: product.selected_or_first_available_variant.inventory_quantity
                          -}}
                        {%- else -%}
                          {{- 'products.product.inventory_low_stock' | t -}}
                        {%- endif -%}
                      {%- else -%}
                        
                          {{- 'icon-inventory-status.svg' | inline_asset_content -}}
                        
                        {%- if block.settings.show_inventory_quantity -%}
                          {{-
                            'products.product.inventory_in_stock_show_count'
                            | t: quantity: product.selected_or_first_available_variant.inventory_quantity
                          -}}
                        {%- else -%}
                          {{- 'products.product.inventory_in_stock' | t -}}
                        {%- endif -%}
                      {%- endif -%}
                    {%- else -%}
                      {%- if product.selected_or_first_available_variant.inventory_policy == 'continue' -%}
                        
                          {{- 'icon-inventory-status.svg' | inline_asset_content -}}
                        
                        {{- 'products.product.inventory_out_of_stock_continue_selling' | t -}}
                      {%- else -%}
                        
                          {{- 'icon-inventory-status.svg' | inline_asset_content -}}
                        
                        {{- 'products.product.inventory_out_of_stock' | t -}}
                      {%- endif -%}
                    {%- endif -%}
                  {%- endif -%}
                

thanks!

Hi @INFRA ,

Please go to Customize > Product > Default product > Inventory status. You can change it here

1 Like