Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Variant selector not changing price or image: how to fix it

CNV-137Medium impactPartlyBy FunnelGuardPublished Updated
On this page

What this issue is

A product page with variants lets shoppers choose options such as size or colour. When you pick one, the page should update the price, the main image, the stock message and the hidden value that is sent to the cart. This issue is when the choice is made but the page does not react. The dropdown or swatch changes, yet the price and image stay as they were.

Why it costs you leads or sales

Shoppers want proof that they chose the right item. If the red shirt photo stays blue, or the large size still shows the small size price, they hesitate or leave. Some will buy anyway and get the wrong item, which leads to returns and refunds. Ad traffic makes it worse, because you pay for every visitor who bounces here.

Where the shopper journey breaks
  1. Ad clickVisitor lands on product page
  2. Pick size/colourPrice and image do not update
  3. Add to cartDoubt, or wrong variant added
  4. CheckoutOrder never placed or later refunded

The selector fails, so later steps lose trust or send the wrong variant.

Add-to-cart rate with and without a working selectorExample numbers
Add-to-cart rate with and without a working selector (example)Selector works: 8 %; Selector broken: 3 %03683Selector worksSelector broken%

Example: illustrative numbers only, showing how doubt at the variant step can reduce add-to-cart rate.

How to check if your site has it

Test the selector by hand
  1. Open a product with variants

    Use a private window so cached files and logged-in admin tools do not hide the problem.

  2. Pick every option

    Change each size and colour in turn. After each choice, note the price, the main image, the selected label and the stock message.

  3. Check the console

    Press F12, open the Console tab and reload. Red errors on the product page often point to the script that handles variants.

  4. Add to cart

    Add each tested variant and check the cart shows the same option and price.

  5. Test on mobile

    Repeat on a phone. Swatches and dropdowns often use different code on small screens.

  6. Try a few products

    If only one product fails, suspect its variant data. If all fail, suspect the theme or an app.

How to fix it

Common causes: a JavaScript error that stops the theme script, an app or plugin that rewrites the product form, a recent theme update, variants with no image assigned, or a cached script that no longer matches the page. Start with the platform you use.

Fix by platform
  1. Assign images to variants

    In Products, open the product, click a variant, and set its image. Without this the main image will not change.

  2. Disable recent apps

    Turn off product-page apps (swatches, bundles, upsells) one at a time and retest. Check the theme editor app embeds too.

  3. Compare with the original theme

    Preview your published theme against an unmodified copy. If the copy works, a custom code edit in the product template or section is the cause.

  4. Check variant options

    Make sure each variant has a price and that option names match what the theme expects.

Minimal example: update price and image on changejavascript
document.querySelectorAll('select.variant').forEach(function (el) {
  el.addEventListener('change', function () {
    var opt = el.options[el.selectedIndex];
    document.querySelector('.price').textContent = opt.dataset.price;
    document.querySelector('.main-image').src = opt.dataset.image;
    document.querySelector('input[name=variant_id]').value = opt.value;
  });
});
Variant selection before and after the fix

Broken

  • Pick Large: price stays at the Small price
  • Pick Red: image stays blue
  • Console shows a red script error

Fixed

  • Pick Large: price updates
  • Pick Red: image switches to red
  • Cart shows the same variant

How to confirm it's fixed

Confirmation checklist
  • Every option changes the price when prices differ
  • Every colour shows its matching image
  • The selected label matches the choice
  • No red errors in the console on the product page
  • The cart shows the chosen variant and price
  • Works on desktop and mobile
  • Works in a private window after clearing the cache

How to prevent it happening again

Most breaks follow a change: a theme update, a new app, a plugin update or a new script. Test a variant product after each one, ideally on a staging copy first. Keep variant data tidy: a price and an image for every variant, and consistent option names. Avoid stacking several apps that rewrite the same product form.

How it often unfolds
  1. Day 1

    A new swatch app or theme update goes live

  2. Day 1

    The variant script throws an error and prices stop updating

  3. Days 2-10

    Shoppers hesitate, bounce or order the wrong variant

  4. Day 11

    Someone notices, rolls back or fixes the script

How FunnelGuard handles this

FunnelGuard detects this only partly. A robot visitor opens your product page on a schedule, selects a variant option and then asserts that expected text is on the page. For example, it can check that the selected size or a price string appears after the choice. If that text does not show, the check fails, it is re-checked from a second region, and you get one alert with a screenshot and a likely cause.

Questions people ask

Why is my variant selector not changing the price?

Usually a JavaScript error, an app or plugin conflict, or a variant with no price set stops the update. Open the browser console on the product page and look for red errors, then disable recent apps or plugins one at a time to find the cause.

Why does my product image not change when I select a colour?

The variant probably has no image assigned, or the script that swaps images is failing. Assign an image to each variant in your platform's product editor, then check the console for errors and retest.

How do I fix variant images not updating on Shopify?

In Products, open the product, click each variant and set its image. Then turn off product-page apps one at a time and compare against an unmodified copy of your theme to find any code that breaks the picker.

Why is WooCommerce variation price not updating?

Common causes are a plugin conflict, a minify or delay-JavaScript setting that breaks the variation script, or a variation without a price. Check Product data > Variations, exclude WooCommerce scripts from optimisation and clear the cache.

How do I test product variants on my website?

Open the product in a private window, choose every option and check the price, image and label after each one. Then add each variant to the cart and confirm it matches. Repeat on a phone.

Can a variant selector look fine but send the wrong item to the cart?

Yes. The page can update visually while the hidden variant id field keeps an old value. Always add the variant to the cart and check the cart line shows the option you chose.

Can FunnelGuard detect a broken variant selector?

Partly. It selects an option on your product page and asserts that expected text appears. It does not verify that the image changed or check every variant, so keep a manual check of key products after site changes.

Does FunnelGuard catch this?

Partly

FunnelGuard checks part of this.

How: select + assert text.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.