magmi-git
magmi-git copied to clipboard
Syntax for multiple image upload with the datapump.
We are currently importing 5000 products successfully with the MAGMI Datapump api. The import works great, but we cannot determine the syntax for importing multi images for each product. For the single image we do the following:
$newProductData['image']='+'.(string)$item->MarketingInfo->Media->Images->Image;
We have tried to loop through our XML object for each image like this:
foreach ($item->MarketingInfo->Media->Images['Image'] as $image){ $newProductData['media_gallery'] .= '+'.(string)$image->Image . ';' . $newProductData['media_gallery']; }
But to no avail.
Can anyone provide the syntax for importing into the media_gallery with MAGMI Datapump API?
The syntax looks correct. We're doing a similar thing successfully...
$magmi = array('sku' => 'myproductssku');
$magmi['image'] = "path/to/main/image.jpg";
// if you want the main image to appear in media gallery:
// $magmi['image'] = "+" . "path/to/main/image.jpg";
$mediaGallery = array('path/to/gallery/image1.jpg','path/to/gallery/image2.jpg','path/to/gallery/image3.jpg');
$magmi['media_gallery'] = implode(";",$mediaGallery);
Works perfectly.
Thanks, darinda I'm going to try your syntax and see if I get better results.
Hi @darinda , I use the same datadump api but I cant update the images see below code:
`$insertArray = array(
"sku" => $row['sku'],
"image" => '10000518.jpg',
"small_image" => '10000518.jpg',
"thumbnail" => '10000518.jpg',
);
$dp->ingest($insertArray);`
Using this code I import more than 5 lakh products but images are not inserting please let me know if you an idea?