![]() ![]() UPDATE `magento2_database_name`.`catalog_eav_attribute` SET `is_visible` = '1', 'using_in_product_listing' = '1' WHERE `catalog_eav_attribute`.`attribute_id` =162 UPDATE `magento2_database_name`.`eav_attribute` SET `frontend_model` = 'Magento\\Catalog\\Model\\Product\\Attribute\\Frontend\\Image' WHERE `eav_attribute`.`attribute_id` =162 Open your database with phpMyAdmin or MySQL and try to mirror any system attribute like small_image use magento2_database_name You can do it programmatically or following this guide. Now you must apply to it the right model and front end visibility. Once you created the attribute you'll be able to apply it on any catalog image. I've recently implemented a my solution by doing the following:Ĭreate an image catalog attribute (let's say that the new attribute ID 162). You don't need to modify or override view.xsd, this file is just for validation. Therefore I created a etc/view.xml file in my module with the following content: īut now I get the following error: Invalid XML in file /var/and add new type of media_attribute However, on the frontend I would like to display this image. ![]() When I now login into the Magento2 backend and alter a product I can choose the image type "opengraph_image" while uploading or editing product images. I added a new EAV attribute though my InstallData.php script which works fine. The goal of a module I'm currently developing is to add a custom image type called "opengraph_image". ![]()
0 Comments
Leave a Reply. |