I've been trying to find an article/question related to the creation of an 'image' type attribute for a product in Magento 2. That is: having just a browse field where the user can upload an image (something similar to the category image upload).
So far I've found this:
create product image attribute in magento2
But it doesn't seem to describe the whole way on how to do it. Is it really necessary to create a custom class to manage this?
Thanks!
Best Answer
You can add and extra attribute image to product entity using an InstallData / UpgradeData file in your module.
Have a look to the following example:
I am using this to add an attribute called
mouseover_image
to the product entity.Then I can upload any image and assign the attribute or role to it
Hope it helps.