Product images not changing with dropdowwn variants

Topic summary

A store owner is experiencing an issue where product images don’t update when customers select dropdown variants (like color or flavor), though the correct images appear after page refresh. The problem appears to be JavaScript-related rather than a variant setup issue.

Key Details:

  • Images change correctly when color swatches are enabled, but this only works for actual color variants
  • All variant images display down the page on desktop (not mobile), making pages excessively long
  • The store uses a custom theme with previous code modifications for page width

Current Status:

  • A community member (abdulmoeed37) is actively working on fixing the JavaScript code
  • Work is being done on a duplicate theme to avoid disrupting the live site
  • There was a brief interruption when the store owner received security alerts about logins from Pakistan, but access has been restored
  • The fix is in progress with multiple issues identified and partially resolved
Summarized with AI on November 1. AI used: claude-sonnet-4-5-20250929.

Hi everyone Im sure ive asked this before but never had a solution.

On my store when I select a product variant ie: Colour / Flavour the image is not changing even though these are set up as variants.

When i Colour swatch toggled on the images do change but with swatch on it only really recognises actual colours now multip;le colour variants.

Please can anyone help as its been driving me crazy for months?

Example item https://ljvapes.co.uk/products/jwn14877263790457?variant=55023674884474

Happy to give any further info needed if it will help

Hi @Ljvapes , Can you download your theme and share your zip file with us? We will help you check it.

Hi im sorry but i dont feel comfortable sharing my entire theme file with some one as this as you know contains sensitive info

It seems that the issue is with Javascript code.

Because when I select the variant and refreshes the page the correct variant image appears so the javascript for variant change is not working.

Would you please let me know which theme are you using? Have you edited any code in the theme?

Hi thank you for the response . Some code was edited a while ago but only foe page width etc ?

The theme was a custom theme i believe?

Okay so I need to add custom javascript code on your store in order for it to work

If you feel comfortable then please give collaborator access to your store so that I can fix the issue

Hi thank you for the response . The collab code is 1632 if you can request it will approve .

Also I notice that all the variant images are all listed all down the page on desktop not mobile so it makes the page really long .

Hi did you get the store access please ?

Hi yes I got the access

I am just analyzing your theme code and I will be adding and updating the code in the next few days

I will update you once I am done

Hi thank you for the help.

I have created a duplicate of the theme encase anything goes wrong.

Hi @Ljvapes , I was working on the theme and fixed few issues but I think you have removed the access.

There are still few issues that need to be resolved.

Hi

I had multiple security emails from shopify sent to me saying account compromised and to secure my account details.

I noticed multiple logins from Pakistan so am a bit reluctant.

Ahh okay not a problem.

I am from Pakistan and when I logged in through my partner account it sent you the email.

I am just here to help the people in the community in need to solve their store problems.

If you still need any help, let me know.

Hi were you dong the work on a duplicate theme or live theme please? .

Yes, I was working on the duplicate theme.

Ok thank you .

Thats fine please can you send another request and ill approve, im just concerned that my live theme was being adjusted .
Code 4467

Apologies im just being cautious.

No worries.

I just sent you the request.

I just accepted it thank you

okay let me fix your issues and once fixed I will let you know.

Thanks