Quick question, is there an option to adjust the size of the visual swatch on the product page? Thank you!
Solved! Go to Solution.
I think there may be a multi-step process to get the image size to change.
1. Get a nice easy to repeat example of what you are trying to do
2. Go to github.com
3. Raise an issue reporting a bug...
(I asked internally - the suspicion is there is actually a bug there which is why it is not working as it should. Feel free to raise a ticket on GitHub if you want it tracked, but the PM is now aware of it and suspects something might be broken. If there is a bug, then there is probably nothing you can do - other than provide a test case, or submit a pull request with a bug fix! ;-) )
The swatch size is defined in vendor/magento/module-swatches/etc/view.xml. (That is, its in the Magento/Swatches module, in the etc/view.xml file. You can define another module to override the default settings.)
If I answered, can you mark as accepted? Helps with my tracking unanswered questions. Thx!
I made the necessary changes to public_html/vendor/magento/module-swatches/etc/view.xml and it didn't seem to adjust the size of the swatches. Am I missing any other steps?
Thanks
Ignoring the point that you should never modify the code of other modules in real life, I tried and found the same problem. Changing that file, flushing all the caches, seemed to have no effect. So I am not sure what those particular settings do myself.
I was having a look at vendor/module-swatches/view/frontend/web/css/swatches.css - it seems to control a fair bit of the CSS on the page. That might be something to explore. It talks about minimum sizes for images for example.
Could you do me a favor? Can you clarify exactly what you are trying to change the dimensions of? Use Luma as a reference site. I want to make sure I am looking for the same setting as you need. Thx
akent99 - One quick question, I can get the border size around the swatch image to change, however I can't seem to change the swatch image itself. What changes should I make to adjust the image size?
Thanks,
Rob
I think there may be a multi-step process to get the image size to change.
1. Get a nice easy to repeat example of what you are trying to do
2. Go to github.com
3. Raise an issue reporting a bug...
(I asked internally - the suspicion is there is actually a bug there which is why it is not working as it should. Feel free to raise a ticket on GitHub if you want it tracked, but the PM is now aware of it and suspects something might be broken. If there is a bug, then there is probably nothing you can do - other than provide a test case, or submit a pull request with a bug fix! ;-) )
Will do, thanks for you help!