Skip to content

Shopify Dude Fix

Why Did Shopify Variant Images Stop Changing When a Customer Selects a Variant?

Shopify variant images can stop switching because the variant-media association is stale or theme variant-change JavaScript is broken. Re-save the image assignment before rewriting code.

A customer selects another color or variant, the price and variant can update, but the main product image stays frozen.

The likely causes

The variant-to-image association can be stale or incorrect, or the theme’s variant-change JavaScript can fail to move the gallery to the selected variant’s featured media.

The confirmed Community fix

A Dawn merchant fixed the issue by assigning a temporary different image to each affected variant, saving, then reassigning the correct image and saving again. The media switching began working without custom code.

Admin path

  1. Go to Products.
  2. Open the affected product.
  3. Under Variants, assign a temporary image to the affected variant and save.
  4. Reassign the intended image and save again.

Developer checks

Test a direct variant URL such as:

/products/example-product?variant=123456789

If a page refresh displays the right image but clicking the selector does not, inspect the variant-change/gallery JavaScript. Also verify that the selected product-form name="id" value changes.

Sources