0

I want to upload multiple images of 1 product using System > Import/Export > Dataflow - Profiles,

My question is about

System > Import/Export > Dataflow - Profiles

Not About

System > Import/Export > Import 

I have uploaded a product with single image, but don't know what csv format to use for multiple image of one product ?

Please Help, Regards.

2
  • I have the same question. did you manage to figure this out?
    – user6330
    Commented Apr 25, 2014 at 16:23
  • @Harry No, Bro, But I managed to import product along with multiple images using System > Import/Export > Import Option
    – LuFFy
    Commented Apr 28, 2014 at 10:04

1 Answer 1

1

Looking at the product converted used in the dataflow module Mage_Catalog_Model_Convert_Adapter_Product it would appear that it can only deal with one product image :(

foreach ($product->getMediaAttributes() as $mediaAttributeCode => $mediaAttribute) {
    if (isset($importData[$mediaAttributeCode])) {
        $file = trim($importData[$mediaAttributeCode]);
        if (!empty($file) && !$mediaGalleryBackendModel->getImage($product, $file)) {
            $arrayToMassAdd[] = array('file' => trim($file), 'mediaAttribute' => $mediaAttributeCode);
        }
    }
}

This code seems to simply set a single file that later gets added to the product data. What you could do would be to rewrite this class and update the code to deal with more than one product image.

Something like the following may point you in the right direction.

$allImages = explode(',', $importData['media_gallery']);
foreach ($allImages as $file) {
    $imagesToAdd[] = array('file' => trim($file));
}
$mediaGalleryBackendModel->addImagesWithDifferentMediaAttributes(
    $product,
    $imagesToAdd, Mage::getBaseDir('media') . DS . 'import',
    false,
    false
);

Not the answer you're looking for? Browse other questions tagged or ask your own question.