So it works, but there is one problem left. The Variant-Images just get dispayed if I click on the button to change the size. But it doesn’t works if i just refresh the product-page, because then unfortunately all images get displayed, but I just want to show there also just the filtered variant images.
I think that I have something to change in the global.js
Because there I added the Code “this.filterMedia();” as on the website “websensepro.com” shown to the function “onVariantChange()”.
So I think the Code “this.filterMedia();” should be added to any other area, where it get triggered on webpageRefresh. But because I’m not a developer I’m not sure, if this is the solution.
I hope anyone could help me. I’ve really tried everything.
I also created a code for this but yes at first load, it will show all the product images, since the function only triggers when there is a change of the variant options. You have to provide an initial function for this
So I replaced just the old function filterMedia() in the global.js file (which I had from the website “websensepro.com”) with your new function filterMedia()