magmi-git icon indicating copy to clipboard operation
magmi-git copied to clipboard

Syntax for multiple image upload with the datapump.

Open kidtangerine opened this issue 9 years ago • 3 comments

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?

kidtangerine avatar Mar 20 '15 03:03 kidtangerine

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.

darinda avatar Apr 01 '15 15:04 darinda

Thanks, darinda I'm going to try your syntax and see if I get better results.

kidtangerine avatar Apr 01 '15 22:04 kidtangerine

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?

rajanzestard avatar Aug 23 '17 11:08 rajanzestard