I hope you are doing well!
We can achieve showing the images of selected variant using the variants metafields as well. Here are the steps to do so -
- Create variant metafields to store name of images
- Add image names as values in product variant metafield
- Apply a custom code in liquid to identify the images of variants
- Add JS code to show only selected variant images.
Here is a demo video to show above steps for the Dawn theme 12.0.0 : https://youtu.be/E3TKR5bb-B4
Please let me know if more details are needed.
Thanks & Regards,
Scale-up print