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.

  • I have the same question. did you manage to figure this out? – user6330 Apr 25 '14 at 16:23
  • @Harry No, Bro, But I managed to import product along with multiple images using System > Import/Export > Import Option – LuFFy Apr 28 '14 at 10:04
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
);

protected by Community Aug 7 '14 at 5:17

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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