3

First of all, thanks for MAGMI, Dweeves

I've been able to get Magmi working to import the product data without an issue.

The image, small_image and the thumbnail are visible on admin and front-end.

I am trying now for days to import the rest of the additional images, but so far I have no luck.

The image name is the same as the SKU, for example 9781907339363.jpg, SKU is 9781907339363.

The additional images are 9781907339363_01.jpg, 9781907339363_02.jpg, 9781907339363_03.jpg ...etc...

or

SKU, image,"additional image" 1000629871, 1000629871.jpg, "1000629871.1.jpg, 1000629871.2.jpg, 1000629871_3.jpg" ...etc...

I hope that it is not a option to put all off these additional images by name in the csv file, i have about 50.000 SKU and about 120.000 images. So not all the SKU has addional images.

I hope somebody can give me a direction how to import the addional images.

Magmi : 0.7.18

Image attributes processor : 1.0.25

4
  • your all products are imported successfully?
    – Keyul Shah
    Jan 17, 2014 at 17:38
  • Yes, all the data i need was imported.
    – Ron
    Jan 17, 2014 at 22:20
  • Yes, all the data i need was imported. Only the additional images, i don't know how to do it? It is a data from Zencart. I used the add-on imagehandler for this. When you see a product on the website, for example "9781907339363" imagehandler shows all the images with the SKU 9781907339363. The main image 9781907339363.jpg and the additional images 9781907339363_01.jpg, 9781907339363_02.jpg ...etc... The path from the additional images are not stored in the database.
    – Ron
    Jan 17, 2014 at 22:36
  • 2
    This question appears to be off-topic because it is about a third party module, please contact them directly for support. May 21, 2014 at 7:16

3 Answers 3

7

In your CSV file, the header for your extra images must be titled : media_gallery

then is should contain the following structure for additional images:

sku_01.jpg::sku_label;/sku_02.jpg::sku_label;/sku_03.jpg::sku_label;

(note 1: in this example the separator is ; so make sure it's the case in your magmi settings)

(note 2: image, small_image, thumbnal, image_label, thumbnail_label must also be in the CSV. In other words, you must not include the first image inside media_gallery, but only the additional ones.

More info from the magmi wiki: http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Image_attributes_processor#media_gallery_.28extra_images.29_column_syntax*

I hope this helps.

edit - your images must be located in media/import Are your images taken from a remote url ? Or are they on your magento server ?

4
  • I have followed your instructions, and it works. I have fill the csv file with this information: 2013/9783899204599_01.jpg::9783899204599_label;2013/9783899204599_02.jpg::9783899204599_label;2013/9783899204599_03.jpg::9783899204599_label And it shows in admin and frontend the additional images from SKU 9783899204599 But then I have to fill the .csv file with all this information. I don't know which SKU has multiple images and if so, how many? My example was sku_01, sku_02, sku_03 but perhaps there are SKU with more then 3 additional images. And there are SKU with no additional images.
    – Ron
    Jan 18, 2014 at 23:23
  • ok so my answer was the solution for your initial question (import extra images). It's not a problem if a sku doesn't have any extra pictures your pictures folder, or if they are 1, 2 , 3 or more extra pictures. Magmi will skip the missing pictures and continue with the next sku. So you can put sku_01.jpg::sku_label;sku_02.jpg::sku_label;sku_03.jpg::sku_label;sku_04.jpg::sku_label;etc... for every row in your csv. Import will be slower though. Note that this is not the best method but it should work. Jan 19, 2014 at 17:17
  • I found out now after looking at the pictures on the server, there are people they have used SKU-01.jpg/SKU-02.jpg... or SKU.01.jpg/SKU.02.jpg... or SKU.1.jpg/SKU.2.jpg... or SKU_1.jpg/SKU_2.jpg... etc And even that Imagehandler is handle this. So your answer is the solution, when i do a search which kind of extra sign they have used for a certain SKU.......So more days to go.....
    – Ron
    Jan 19, 2014 at 17:48
  • Ok glad it worked out. Good luck! Please note answer as valid solution so this question can be marked as solved, thanks. Jan 19, 2014 at 20:52
1

I think one of the good solution is below You have to write your custom script assign image to that specific product.

1) Create one PHP file in your root folder name is importmages.php.

2) Copy and paste the below code. this is only demo code you have to change as per for requirement.

<?php
    error_reporting(E_ALL | E_STRICT);
    $mageFilename = 'app/Mage.php';
    require_once $mageFilename;
    $app = Mage::app('default');  
    ini_set('display_errors', 1);

    $products = Mage::getModel('catalog/product')->getCollection()
                ->addAttributeToSelect('*');        

    //suppose we fetch the SKU of the product and dynamically generate the name like sku_01.jpg and assign to product Object and save the data. Make sure your all images into media/import Folder.

    foreach($products as $_prduct)
    {
        $sku=$_prduct->getSku();
       // Now create the path for Image.
        $filename1 = $sku."_01.jpg"; 
        $filePath1 = Mage::getBaseDir('media') . DS . 'import' . DS . $filename1;
        $prod=Mage::getModeil('catalog/product')->load($_product->getId());
        $prod->addImageToMediaGallery($filePath1, array('thumbnail','small_image','image'), false, false);
        $prod->save();
        unset($prod);
    }
?> 
4
  • I have to study this, i am not a PHP expert.
    – Ron
    Jan 18, 2014 at 23:25
  • hmm then study and let me know if you stuck.
    – Keyul Shah
    Jan 19, 2014 at 1:44
  • I have studied this for hours now and using google, but I can not get it out, sorry and also studied imagehandler.php but also this script is to complicated for me.
    – Ron
    Jan 19, 2014 at 11:21
  • I am stuck! can you help me further?
    – Ron
    Jan 20, 2014 at 23:43
0

Add Below Data To Your Import Data Array

$importData['image'] = "https://wow.olympus.eu/webfile/img/1632/oly_testwow_stage.jpg";
$importData['image_label'] =  "base Image label";

$importData['small_image'] = "https://wow.olympus.eu/webfile/img/1632/oly_testwow_stage.jpg";
$importData['small_image_label'] = "small Image label";

$importData['thumbnail'] = "https://wow.olympus.eu/webfile/img/1632/oly_testwow_stage.jpg";
$importData['thumbnail_label'] = "Thumbnail Image label";

$importData['media_gallery'] = "https://cdn.hackernoon.com/hn-images/0*xMaFF2hSXpf_kIfG.jpg::TestImage1;https://images.sftcdn.net/images/t_app-cover-l,f_auto/p/befbcde0-9b36-11e6-95b9-00163ed833e7/260663710/the-test-fun-for-friends-screenshot.jpg::testImage2"

Note: Image attributes processor must be check (ON) from magmi setting in your Magmi Profile.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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