i'm using the Avs_FastSimpleImport extension to import my products from an csv file. Im building up my product array according to the documentation of the extension, found here
I manage to import the base_image for now. But i have three images (base_image, small_image & thumbnail) and dont find the right solution how to import the other two. According to this, it should be an array, or what:
my code for images, so far:
'_media_attribute_id' => !empty($media_attribute_id) ? $media_attribute_id : null,
'_media_image' => isset($product['image']) ? $product['image'] : null,
'image' => isset($product['image']) ? $product['image'] : null,
'small_image' => isset($product['small_image']) ? $product['small_image'] : null,
'thumbnail' => isset($product['thumbnail']) ? $product['thumbnail'] : null,
My Question is how to build up my array to be able to import and set the thumbnail and small_image.
Thanks in advance
Best Answer
There are two options for this. It's more comfortable to use nested arrays (see http://avstudnitz.github.io/AvS_FastSimpleImport/options.html: "Support Nested Arrays for Import"), you can then use arrays inside the media* attributes like this:
'_media_attribute_id' => array(77, 77, 77), '_media_image' => array('img1.jpg', 'img2.jpg', 'img3.jpg', '_media_is_disabled' => array(1, 0, 0), '_media_position' => array(1, 2, 3), '_media_lable' => array('Image 1', 'Image 2', 'Image 3'),
If you don't want to use nested arrays, you can have seperate arrays for the additional rows per product as described in http://www.integer-net.com/2012/04/04/importing-products-with-the-import-export-interface/. Just don't provide a "sku" value (just
null
instead) for the additional rows.