Find the base image attribute id from eav_attribute.
1 |
attr_id = SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = "image" AND `frontend_label` = "Base" LIMIT 1; |
Find all images which having a Base image role.
1 |
value = SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = (attr_id); |
Find all ids from the media gallery.
1 |
gallery = SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN (value); |
Update the media gallery value to 0.
1 |
UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 0 WHERE `value_id` IN (gallery); |
Final query:
1 2 3 4 |
UPDATE `catalog_product_entity_media_gallery_value` SET `disabled` = 0 WHERE `value_id` IN ( SELECT `value_id` FROM `catalog_product_entity_media_gallery` WHERE `value` IN ( SELECT `value` FROM `catalog_product_entity_varchar` WHERE `attribute_id` = ( SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = "image" AND `frontend_label` = "Base" LIMIT 1 ) ) ); |
[crayon-63e099ff2f345278773613/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.