0

So let's say I have a configurable product having an option of colour with 2 values: Black, White.

I want to make the thumbnail images of the parent product stay, even when I select any colour.

Here is my parent product: enter image description here

And this is my child product:

enter image description here

So can you guide me how to do that? Without re-adding images. I'm using Magento 2.2.1

1 Answer 1

0

In order to stop, reload of you need work on configurable.js file:

On this js at _configureElement(), you need to remove this._changeProductImage();

this._reloadPrice();
this._displayRegularPriceBlock(this.simpleProduct);
this._displayTierPriceBlock(this.simpleProduct);
this._displayNormalPriceLabel();
//this._changeProductImage(); // remove this line

Who to do it: First,you should check configurable.js exits at your theme level means

app/design/frontend/{YourThemeVendor}/{YourThemeName}/Magento_ConfigurableProduct/web/js/configurable.js

If exits then comment the _changeProductImage.

Or if it does not exits then copy the file from

vendor/magento/module-configurable-product/view/frontend/web/js/configurable.js

then paste at

app/design/frontend/{YourThemeVendor}/{YourThemeName}/Magento_ConfigurableProduct/web/js/configurable.js

Do comment _changeProductImage.

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.