In Magento2 default swatch function is we are select the color swatch disable the nonconfigurable option like size is not there.Like below image


how can i write the same functionality with mousehover on configurable swatches


1 Answer 1


You will need to override the file located swatch-renderer.js at -


You will need to look for the code -

_EventListener: function () {

This function triggers the onclick and does the function. In here you can change the lick to hover. I believe this will also effect on the product list page so you will have to see accordingly.

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.