Variant default causing an error

AI-generated summary

The issue is a Shopify product variant mismatch: changing the colour to white leaves the previously selected logo option active, creating an unavailable combination, so the image and variant selection error instead of switching to the valid black-logo option.

Replies agree that Shopify only uses the first variant in the admin as the default on initial page load and does not natively “rematch” dependent options after a customer changes one option. Reordering variants can change the first-load default, but it will not solve the colour/logo mismatch during selection.

Suggested fixes include:

  • Enable “hide unavailable variants” in the Horizon theme if available, though this may not auto-select a valid logo.
  • Add custom JavaScript to detect invalid combinations and switch to the first available logo for the chosen colour, including support for product pages and homepage Quick Add.
  • Re-model the product options so invalid combinations do not exist, such as combined options like “White / Black logo.”
  • Use a product-options or linked-variants app with conditional logic.

The discussion remains unresolved; the store owner says they need to keep the logo variant and are leaning toward a code-based solution.

Can someone advise how I can change the default variant for products? For example on the above link, when selecting white colour, you will see an error and the image won’t show white variant as it requires a black logo. Is there a way I can change this so it defaults to the logo option available for that colour?

Thanks

Hey @HyperactiveDesigns, Shopify does not rematch the other option when you change colour. It keeps the last logo you had selected, so White plus that logo becomes an unavailable combo and the image stays put.

There is no admin setting for “default logo per colour.” The default variant is just whichever variant sits first in the product admin, and that only applies on first load.

Check the product section in the theme editor for a hide unavailable variants setting on the variant picker. That stops people landing on a combo that does not exist. If the theme still keeps the old logo after a colour change, you need a small bit of theme JS that, on colour change, picks the first available logo for that colour.

hi @HyperactiveDesigns

Shopify only uses a default variant on first load. That is the first variant in the product’s variant list. After that, when someone changes Colour, Shopify keeps the Logo they already had selected. If White + that logo does not exist (e.g. White only works with a black logo), you get the error and the image does not update.

1. Set the variant that opens first

Shopify Admin → product → Variants → drag the variant you want first (e.g. White / Black logo). That is the only native “default variant.”

2. Fix the White + logo mismatch

You need a real variant for each colour + logo combo you want customers to land on. If White should always use the black logo, make sure White / Black logo exists.

That still will not auto-switch Logo when they pick White if they previously had another logo selected.

3. Auto-select the logo that exists for that colour

Shopify does not do this by itself. Options:

  • Theme editor → product page: turn on hide unavailable / out-of-stock variants if your theme has it (stops them picking an invalid combo, but may not auto-pick the other logo).
  • Use a variant picker / linked-options app that, when Colour changes, jumps to the nearest available combination (White + black logo instead of keeping the old logo).
  • If some logos never apply to some colours, consider Combined listings or separate products so invalid combos are not on the same picker.

If you share the product admin screenshot (Colour + Logo options and which variants exist), we can say whether this is missing variants or just the picker not switching Logo.

I am using the horizon theme. Currently 4.1.1 but looking to update to 4.1.4

I need to keep the logo variant so have to go with a code model

Yes there is a quick add option on the home page.

Tim from Sonder Sites in Melbourne. We write Horizon patches like this quite a bit.

Shopify will not rematch Logo when Colour changes. It keeps the last logo, White plus White Logo becomes unavailable, and Horizon does not pick Black Logo for you. Updating from 4.1.1 to 4.1.4 will not fix that.

Do the work in a duplicate theme, not live. Do not edit assets/variant-picker.js. A small custom script that runs after the picker refreshes, stays inside the active product form, and if the checked Category input has aria-disabled=“true” clicks the first available one, is the safe version. It has to cover the main product page and homepage Quick Add, and it must not let one Quick Add card change another.

Test Red to White, White to Red, a direct ?variant= link, and mobile Quick Add before you publish.

If you get stuck wiring that to Quick Add, we are in Melbourne and happy to look at the duplicate theme with you.

The behaviour you’re fighting is by design: Shopify only uses “first variant in admin order” on initial load. After that, when the shopper changes one option, the theme keeps their other selections — even if that combination doesn’t exist. There is no built-in “snap to nearest valid variant”.

Two ways out, in order of preference:

1. Model it away (no code). If White is only ever sold with the Black logo, the Logo option isn’t really a free choice — it’s determined by Color. Collapse the two options into one: White / Black logo, Black / White logo, etc. Invalid combinations stop existing, quick-add stops erroring, and you never maintain a script through theme updates. This is worth reconsidering even if it means re-creating the product.

2. Auto-snap script. If you keep two options, the logic you want is: on option change, if the resulting combination has no variant, find the first available variant that matches the option the shopper just changed, and set the remaining selects to it. Pseudocode against the product JSON every theme exposes:

const variants = PRODUCT_JSON.variants; // from the product JSON script tag
function snap(changedIndex, changedValue) {
  const exact = variants.find(v => selectedOptions().every((val, i) => v.options[i] === val));
  if (exact && exact.available) return; // combination is fine
  const fallback = variants.find(v => v.available && v.options[changedIndex] === changedValue);
  if (fallback) setSelects(fallback.options); // and dispatch 'change'
}

The selectors for selectedOptions/setSelects differ per theme (Horizon renders its picker as a custom element), so wire it in a custom liquid block rather than editing theme files — it survives updates that way. But honestly: if your option matrix is mostly-invalid combinations, option 1 will save you this whole class of bugs, including in search filters and inventory reports.

This looks like a variant selection default variant logic issue, rather than a problem with the product itself.

The theme is likely trying to load a specific logo variant combination that doesn’t exist for the selected colour. Instead of falling back to the first available logo variant, it throws an error.

I’d check the product’s variant configuration first, then inspect how the theme maps colour logo variant ID. The clean fix is to make the theme automatically select a valid variant whenever the customer changes colour, rather than keeping the previously selected/invalid option.

If the variants are configured correctly in Shopify, this can usually be fixed in the theme’s variant picker JavaScript logic without changing the products themselves.

I can help you troubleshoot and fix it . WhatsApp +234 7066786530

Hi @HyperactiveDesigns
I’m glad to share that your desired set-up can be solved through a conditional logic feature. If you’re open to using an app, this is the kind of setup that Aris Product Options can help structure. You can check out one of our similar demo product to see if it matches what you’re looking for.
Basically, we make sure that 2 options “Color” and “Logo Color” are tied to each other and won’t overlap (E.g. White logo on White background).
Hope to be of help if you find this relevant :smiley: