How to hide a variant if there is only one variant to pick from

Topic summary

A Shopify store owner using the Dawn theme wants to conditionally hide variant selectors (like Size or Material) when a product has only one option available for that variant type.

Key Requirements:

  • Products should remain filterable by size/material in collections, even when only one option exists
  • The variant picker UI should hide when there’s no actual choice to make
  • Multiple products in the same collection may have different numbers of variants

Technical Context:

  • The user identified product-variant-options.liquid and product-variant-picker.liquid as likely files to modify
  • They’re attempting to add conditional logic but are new to Liquid development
  • Code snippet shows existing variant availability logic using case statements

Proposed Solution:
One commenter suggested removing variants through Shopify admin, but this was rejected as it would eliminate filtering capability.

Status: The discussion remains unresolved with no working solution provided. Two later commenters are seeking the same answer, indicating this is a common need.

Summarized with AI on November 9. AI used: claude-sonnet-4-5-20250929.

We have many products which only comes in a singular size, or a singular material. Though we still want them to show up when filtering for the specified size or material. I’ve attached a picture for a visual of what I am talking about.

We want to hide Size and Material

furthermore I have been going down a deep rabbit hole of the code, and found believe to find where I need to edit, though I am unable to see what I should put in a potential if statement, as I am still very new to liquid dev. (Using the Dawn Theme)

I am assuming I either have to edit something:

product-variant-options.liquid

product-variant-picker.liquid

Currently looking at:

{%- for value in option.values -%}
  {%- liquid
    assign option_disabled = true
    for option1_name in variants_option1_arr
      case option.position
        when 1
          if variants_option1_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
            assign option_disabled = false
          endif
        when 2
          if option1_name == product.selected_or_first_available_variant.option1 and variants_option2_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
            assign option_disabled = false
          endif
        when 3
          if option1_name == product.selected_or_first_available_variant.option1 and variants_option2_arr[forloop.index0] == product.selected_or_first_available_variant.option2 and variants_option3_arr[forloop.index0] == value and variants_available_arr[forloop.index0]
            assign option_disabled = false
          endif
      endcase
    endfor
  -%}

within product-variant-options.liquid

Any help is appriciated

Hey @Hae ,

there is no coding needed. You can simply remove the variant through the Shopify admin.

Proceed to the product you want to remove the variants from and perform the edits.

I do not wish to remove the variant, as I would like to still be able to
filter them through material and size.

We have many collections, so two different elements within the same
collection can still have two different sizes, but I would like to still be
able to filter them, without having the variant choice, displayed within
the ‘variant picker’ inside the ‘product information’ block.

1 Like

Hoping you have the answer for this.

Hello :slightly_smiling_face: Did you ever figure this out? thanks