How to Import Product Images from CSV

import

How do you import product images from a CSV file using System > Import/Export > Import?

I've followed suggestions from various sources but nothing works. This is the format of the CSV file:

"sku","image","small_image","thumbnail"
90048,"test.jpg","test.jpg","test.jpg"

The file 'test.jpg' exists in the media/import folder so i'm not sure why this does not work.

We are using Magento CE 1.7.0.2.

When I run the import with the CSV file above the image does not get added to the product.

Best Answer

I have set up a documentation of the product import format of Mage_ImportExport at http://www.integer-net.de/download/ImportExport_EN.pdf which describes in detail how to import for example images.

Regarding your problem: you need a few extra columns to add the image to the media gallery, otherwise it won't get imported:

"sku","image","small_image","thumbnail","_media_image","_media_attribute_id","_media_is_disabled","_media_position","_media_lable"
90048,"test.jpg","test.jpg","test.jpg","test.jpg",77,1,1,"Image 1"

Notes:

  • The _media_attribute_id column requires the ID of the product attribute media_gallery. It can be obtained either from the admin panel or your custom modules using the expression Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId();

  • The typing error _media_lable is intentional and hard-wired into Magento.

Related Topic