Best strategy for color (swatch) filtering for products with and without variants?

Hi, I want to setup a webshop where most products will have a lot of color variants. Though some products may not have variants. Each product and variant has a color and since some of them are quite specific I want to use base colors for filtering. For instance if a product has 5 variants that are some shade of blue, I want to be able to click a Blue filter swatch and as a result the 5 variants should be displayed with their image, along with any other products and variants that have Blue assinged as the base color.

I assume using metaobject, metafield and an app like Search & Discover could be a good starting point. But how do I go about it? Especially that fact that I want to display variants immediately with their image, along with products that may not have variants puzzles me.

The other option is to treat all the variants as products and not use variants at all, but that would make it a bit of a clutter from admin point of view I think. Would like to keep that for plan B.

I appreciate your help.

:small_blue_diamond: Core Problem You want color-based filtering (e.g., clicking “Blue” shows all blue variants and products).

You want variant images to appear directly in collection filtering results, not just the parent product thumbnail.

Some products won’t have variants, but should still respect the base color filtering.

You’d like to avoid treating every variant as its own product (Plan B).

:small_blue_diamond: Option 1: Keep Variants + Use Metaobjects/Metafields This is the more organized & scalable way.

Assign a Base Color to Each Variant

Create a variant metafield (e.g., custom.base_color).

Populate it with values like “Blue”, “Red”, “Green”.

Even if the variant name is “Sky Blue” or “Royal Blue,” its metafield = Blue.

Use Search & Discovery App

Shopify’s Search & Discovery can filter products, but it doesn’t natively filter variants individually.

To work around this, you’ll need a custom collection template or an app that lets you surface variants in collection grids.

Custom Collection Grid to Show Variants

By default, Shopify only shows products in a collection.

You’ll need custom code (or an app like Boost AI Search & Filter, Filter & Search by Power Tools, or Globo Filter) that allows variants to appear as separate filterable items.

With this, when you click “Blue,” the grid will show all variants with base_color = Blue, displaying their variant image.

Fallback for Products without Variants

For products with no variants, just assign the metafield to the product level instead (so it still shows up with the filter).

:backhand_index_pointing_right: This way:

Admin stays clean (you keep variants inside one product).

Filtering is based on base colors, not variant names.

User sees variant thumbnails directly in filtered views.

:small_blue_diamond: Option 2: Treat Variants as Products This works, but as you said, it’s messy in admin.

Every shade variant becomes its own product.

Then you can assign base color as a product metafield and filtering works out-of-the-box.

Easier for filtering logic, harder for management (inventory, product count inflation, SEO duplicates).

This is usually only recommended if:

Your store is very small, or

You absolutely need every variant to act as a standalone product for marketing/SEO reasons.

:small_blue_diamond: Suggested Setup (Best Practice) Keep products with variants (avoid clutter).

Add a variant metafield for base color.

Use a filter/search app that can:

Read metafields,

Filter at the variant level,

Display variants in the collection grid.

:pushpin: Apps that do this well:

Boost AI Search & Filter (most popular for variant-level filtering).

Searchanise (variant-aware filtering).

Globo Product Filter & Search.

:small_blue_diamond: Implementation Roadmap Create base_color metafield at variant level.

Assign values like: Sky Blue → Blue, Navy → Blue, etc.

Install Boost Filter (or similar).

Configure filter: “Base Color”.

Adjust collection template → show variant images directly.

Test with both: product without variants + product with multiple shades.

:white_check_mark: This way you get a clean admin, accurate filtering, and customers see exactly the variant they’re after.

Hi @moonbeetle ,

To filter products by color, you can try our GLOBO Smart Product Filter & Search app. It has a 4.9* rating from nearly 2,000 reviews. The app provides a free plan and a 14-day free trial for the paid plans, so you can test it out and see how it works for your store.

With this app, you should be able to filter products by base colors and display variants with their images, along with any products that share the same color. If you need help setting it up, feel free to reach out to us via email or use the live chat function in the app.

Let me know how it works for you, or if you have any other questions!

Best,
Felix

“products without variants” is actually a wrong term.
Every product in Shopify has at least one variant, even if it was not defined specifically (then it’s called “default variant” and kinda hidden).

Consider that in Shopify you add to cart Variants, not Products.

If you want to filter by option value, then product has to have options(s), so even if there is only one variation of the product, define “Color” option and add a single value.

To simplify selections (like your “blue” example) you can group similar values – https://help.shopify.com/en/manual/online-store/storefront-search/search-and-discovery-filters#grouping-filter-values

And yes, if you filter by color, Shopify will update product featured image and product url on collection page to match this value, should happen automatically and most themes should support it.

Finally, if you’re still not happy with this, you can always define and set a metafield on the product(s) and use this metafield for filtering instead.
Then you can always set this MF with more complex logic, either manually or using an app like Flow or Mechanic…


if my post is helpful, please like it ♡ and mark as a solution -- this will help others find it

When I would use a metafield for assigning a base color, I suppose I better use a variant metafield, not a product metafield, right?

Depends on what you want and how your products are setup/look.

If you set it on a variant, then it does not really differ much from the product option value (and you can group those, so, say Dark Blue, Navy and Light blue can be all “synonyms” under “Blue”).

If, however, you have, say, I dunno, denim bag and it can be red, blue or black, but still, it’s most important characteristic is denim and you do not really want to group “denim” and “red”, then it’s better to have it as a MF on a product. (though you may still have “red denim”, etc…)

Also, check this (if not already) about setting up your colors https://help.shopify.com/en/manual/custom-data/metafields/category-metafields