In magento, I added configurable swatches for color attribute.

The swatches are displayed and the color of the product changes, when the swatches are accessed. But the swatches are not working properly, when it is selected after selecting any thumbnail image i.e. when I select a thumbnail image and then select a color in the swatch, the thumbnail image is displayed instead of the selected color product.

The swatches are working perfectly when no thumbnail image selected in between.

What should be done to fix this issue?

1 Answer 1


Issue resolved.

Its jquery problem.My jquery for displaying the selected thumbnail image as base image is:

efunction changemainimage(srcc,idf)
    if(idf == "imgonly"){

    jQuery(".product-image-gallery .gallery-image.visible").attr("src",srcc);   
else if(idf == "vdionly")

   return false;

Now I made changes in the second 5th line of my code as


Now exactly the selected thumbnail image is displayed as base image.Now the swatches are working perfectly when it is selected after selecting any thumbnail image.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.