Display product variants based on previous chosen variants

Topic summary

A merchant wants to display product size options conditionally based on a gender selection (Female showing sizes 1-3, Male showing sizes 3-5) rather than showing all sizes at once.

Technical Approach:

  • This functionality is called “linked variant options” and requires custom theme development
  • One suggested solution involves creating all size variants (1-5) and using custom tabs with JavaScript to show/hide appropriate sizes based on gender selection
  • A tutorial exists for vintage themes, but OS2.0 themes need adaptation with theme development knowledge

Alternative Solutions:

  • Third-party apps like “Stamp – Collection Variants” can help separate and filter variants by specific options
  • Professional customization services are available for implementation

UX Considerations:

  • One responder cautioned this creates a restrictive user experience path that may not suit all customers (some prefer browsing by size/color first)
  • A/B testing was recommended to validate the approach
  • The original poster defended the design as more intuitive than splitting into separate products
Summarized with AI on October 25. AI used: claude-sonnet-4-5-20250929.

Hello, I want to have variants for a product and each variant should have sub-variants which are only shown if the according variant was chosen.

For example:

Variants: “Female”, “Male”

for variant “Female” I want to show the sizes (sub-variants) 1, 2 and 3

for variant “Male” I want to show the sizes 3, 4 and 5

How could I do this?

(If it is only possible by coding, please tell me how, I have a little bit of experience with coding in shopify)

Not sub variants, sub-options even though that isn’t technically correct either.

This is nominally referred to as linked-variant-options

Keep in mind when doing this you a dictating a restrictive UX path , that could very well be an anti-pattern in your stores customer journey. It may not work for all customers, i.e. some may want to first shop by size or color first instead of gender.

Because after all if this choice is so important why are they not separate products and customers have to make any extra choices at all.

Validate with a/b testing , or skip testing at your peril.

There is an advanced customization tutorial available for VINTAGE themes, for OS2.0 themes it will require theme development knowledge to adapt it.

https://community.shopify.com/c/shopify-design/variants-link-product-options/td-p/615156

If you need this advanced customization then contact me directly by mail for services.
Please always provide context, examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.

Thank you for your answer, but I don’t think that this is something bad for the customer as it even facilitates switching between the female and male version of the same product to see different sizes and it would not really make sense to have 2 separate products just to differenciate between male and female sizes. For me and for the customer it is easier to have one product, be able to choose either female or male and see the sizes we have available for either male or female.

And I think this, along with many other features, should be part of shopify, but somehow there are many key features missing in shopify.

Hi @Felix3qH4

Just create the product variant for sizes that is 1,2,3,4,5.

Now create two tab design on product page file named main-product.liquid

Now you just need to write script which will show appropriate variant on selection of your custom made tab that is Mamle and Female.

Third-party apps make it easy to separate variants. I own the Stamp – Collection Variants app , and we help merchants display variants separately on the collection page and home page. You can customize the settings per collection to show or hide specific variants, filter variants, or separate them by specific options. For example, you can create a “Gold” collection and display only gold-related variants

https://youtu.be/Pdk4JmfJjqQ