how to hide single variant label/button when only has one variant for a product? (Dawn Theme)

Topic summary

Issue: A merchant using Dawn theme (v13.0.1) wants to hide variant labels/buttons for products with only one option (e.g., showing size variants but hiding single-option color/fabric selectors).

Constraint: The merchant needs to keep these single variants in the backend for Google Merchant Center feed requirements, but hide them from the front-end display.

Solution Provided:

  1. Edit product-variant-picker.liquid file in theme code
  2. Add {% assign variant_count = option.values | size %} next to the line {%- for option in product.options_with_values -%}
  3. Add conditional code {% if variant_count <= 1 %}hide_single_variant{% endif %} next to both “product-form__input–pill” and “product-form__input–dropdown” classes
  4. Add CSS rule .hide_single_variant { display: none !important; } to base.css file

Initial Problem: First approach caused “item unavailable” errors because hiding variants broke the add-to-cart flow (which requires all variant options to be selected).

Resolution: The revised solution successfully hides single-option variants while maintaining functionality. Confirmed working by original poster.

Note: One user with Turbo theme v3.0.1 requested similar guidance but lacks the product-variant-picker.liquid file (theme-specific difference).

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

Hi there,

I want to ask that how i can hide single vartiant label/button from my product page. As you can in screen shot i have different sizes for this jacket but i have only one color and fabric option for this product. So i want hide them from all product which has one variant. i am ussing free dawn theme version 13.0.1.

@i_hussain Please always provide store url and password if have when seeking for the help so we can help you!

If you only have one variant, you should not add any options. This way product with one variant will be created.

I have to add them to appear on google merchant otherwise it will show errors in google merchant, and i saw few solution around internet but those are not working properly.

Sorry, I didn’t share it because it was mention that not to share password. And how can i share password in public forum. here is the URL: https://039dfb-a6.myshopify.com/

@i_hussain I was asking for the store front-end password if have i don’t require back-end admin side password!

@i_hussain If we hide from the front-end then how Google Merchant Center will fetch your variant Color and Material in their Feed?

@i_hussain Please follow the below steps to hide the variant that has only one option. Let me know whether it is helpful for you.

  1. Go to “Online stores” → “Themes”.
  2. Click action button from the current theme and select “Edit code”.
  3. Search for “product-variant-picker.liquid” file.
  4. Find the line “{%- for option in product.options_with_values -%}” and paste below code next to this line like in the attached screenshot.
{% assign variant_count = option.values | size %}
{% if variant_count > 1 %}

  1. Find the “” tag and add below code before the {%- endfor -%} as like in the below screenshot.
{%- endif -%}

Before and after code changes will be like below images for this product, https://039dfb-a6.myshopify.com/products/attack-on-titan-scouting-legion-leather-jacket.
Before: (Color dropdown is displayed)

After: (Color dropdown is not displayed)

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.

1 Like

Google always used data feed, so thats why i want it in backend but not dont want show fromt-end

It’s Working, But there is another problem i saw after adding this code, as you can see in screenshot, when you click on variation its saying item is unavailable. you can check live product here https://039dfb-a6.myshopify.com/products/attack-on-titan-scouting-legion-leather-jacket

@i_hussain Yes it will create an error because variant option is hide so without selecting the all variant options will not able to add to cart the product. The flow work like select Size option > Color option > Material option if all are the selected then add to cart button works well! Hiding the variants will create a problem for the flow functionality and google merchant too!

@i_hussain Then I suggest to don’t create color and material variant and instead of this you can create Metafield options to add the color and material so your variant options will not show on the front-end without changing the existing code.

1 Like

Sorry, i am new on shopify so i don’t have any idea about it. Can you please tell me where i can find front end URL and password so, i can share with you.

So, that is no solution for this? :sad_but_relieved_face:

@i_hussain I suggest to don’t create color and material variant and instead of this you can create Metafield options to add the color and material so your variant options will not show on the front-end without changing the existing code.

How can i use meta-field? Is it like we used to create in collections?

@i_hussain Please try hiding the variants using below steps instead of the one shared in previous comment. Let me know whether it is helpful for you.

  1. Go to “Online stores” → “Themes”.
  2. Click action button from the current theme and select “Edit code”.
  3. Search for “product-variant-picker.liquid” file.
  4. Keep the code “{% assign variant_count = option.values | size %}” added next to the line {%- for option in product.options_with_values -%}
    5**.** Remove the codes {% if variant_count > 1 %} and {%- endif -%} added previously.
  5. Then, find the “product-form__input–pill” and “product-form__input–dropdown” class names and paste the below code next to the both classes like in the attached screenshot.
{% if variant_count <= 1 %} hide_single_variant{% endif %}

  1. Search “base.css” file and paste below code at the bottom of the file.
.hide_single_variant {
    display: none !important;
}

Now, it will works fine as we expected.

Please provide your support by click “Like” and “Accepted” if our solution works for you. Thanks for your support.

1 Like

i tried it, it’s not working at all.

@i_hussain Please check the variable declaration code "{% assign variant_count = option.values | size %}" is there in the “product-variant-picker.liquid” file below the line “{%- for option in product.options_with_values -%}” as mentioned in the step 4. Let me know whether it is working for you or not.

sorry, i forget to keep this code {% assign variant_count = option.values | size %}, i just updated code again and now its working properly.

Thank you so Much :blush: