Magento – Setting Product Images for Products not Displaying image

databaseimageproduct

I have many products that have an image uploaded and set for them, but there is no specification made for base small or thumb. The result is I have many more products displaying my no-image backup image than necessary.

Would there be a way to programmatically instruct Magento to take all products without a base specification, but having an image uploaded for them, and make a specification for those products to use thir image as the base image?

Best Answer

All images are stored in catalog_product_entity_media_gallery and the thumbnail, image and small_image in catalog_product_entity_varchar with the respective store_id.

You could find out the attribute_ids going with the small_image, thumbnail and image and create a script which updates these with the same value as in the media_gallery table.

This is the fastest way to get the back in line, of coarse you need to check if it isn't set, and set only one image.

After that change your import or enable the images next time you manually add or update products.