Thursday 7 August 2014

Import All Images in magento

This process doing if don’t have images of the each products.
1-Upload you downloaded images with folders to the /media/import
2-Run the following MySQL Query in the database.(Remember this is only run if don’t have images of the each product.)
INSERT INTO catalog_product_entity_media_gallery (attribute_id, entity_id, `value`)
SELECT ga.attribute_id, v.entity_id, v.value
FROM catalog_product_entity_varchar v
INNER JOIN eav_entity_type et ON et.entity_type_code='catalog_product'
INNER JOIN eav_attribute va ON va.entity_type_id=et.entity_type_id AND va.frontend_input='media_image' AND va.attribute_id=v.attribute_id
INNER JOIN eav_attribute ga ON va.entity_type_id=et.entity_type_id AND ga.attribute_code='media_gallery'
LEFT JOIN catalog_product_entity_media_gallery g ON g.entity_id=v.entity_id AND g.value=v.value
WHERE v.value<>'no_selection' AND v.value<>'' AND g.value IS NULL;
3-Clear all cache in the Magento admin panel and then see the images.

No comments:

Post a Comment