Skip to content

Instantly share code, notes, and snippets.

@Stasevi4
Created October 8, 2014 22:53
Show Gist options
  • Save Stasevi4/bbe258e36f479638d38f to your computer and use it in GitHub Desktop.
Save Stasevi4/bbe258e36f479638d38f to your computer and use it in GitHub Desktop.
Magento Update product set first image as default image , small_image, thumbnail
UPDATE catalog_product_entity_media_gallery AS mg,
catalog_product_entity_media_gallery_value AS mgv,
catalog_product_entity_varchar AS ev
SET ev.value = mg.value
WHERE mg.value_id = mgv.value_id
AND mg.entity_id = ev.entity_id
AND ev.attribute_id IN (70, 71, 72) <------------- Change attribute id (Image, small_image, thumbnail)
AND mgv.position = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment