Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Magento import products with images

I have tried all afternoon to import some products in Magento, but all without any success. After trial and errors it all came down an "Image does not exist" error. I have read a few posts about it, most of them outdated, but then a recent one talks about putting everything in /media/import and having all files named like /image.png in the CSV file.

It does not work and I still get the same error.

I'm using Magento 1.6.2 and I have tried putting the files in

/var/import/image.png
/var/import/i/m/image.png 
/media/import/image.png
/media/import/i/m/image.png
/media/catalog/product/i/m/image.png

I have tried to name the file in the CSV as

/image.png
/1/m/image.png
/media/import/image.png
/media/import/i/m/image.png

...and a bunch of combination of them all (not exactly sure which ones as I used a random approach at first, trying what the forums suggested, but without any luck). I have tried to located the piece of PHP code where the image file is checked, but failed... again.

So, what folder does the importer looks for the file anyway? What is the way of doing this? There are a lot of people with the same problem and it does not seem to be any official solution for this. Any help appreciated.

like image 327
Yanick Rochon Avatar asked Apr 26 '12 21:04

Yanick Rochon


2 Answers

I ftp'd the images into media/import and then in the actual CSV file, the image was /image.jpg.

Here is an example of my working import CSV file. I wrote a php script to hash the database which fed our then catalog and assemble the below output. It did take lots of trial and error to get it working. Do a mysqldump before you try importing so you can blow away mistakes with restores.

"sku"|"price"|"special_price"|"brand"|"weight"|"cost"|"name"|"section"|"description"|"short_description"|"make"|"fitment"|"product_name"|"store"|"websites"|"attribute_set"|"type"|"has_options"|"gift_message_available"|"custom_design"|"options_container"|"image_label"|"small_image_label"|"thumbnail_label"|"page_layout"|"meta_keyword"|"custom_layout_update"|"manufacturer"|"color"|"status"|"tax_class_id"|"visibility"|"enable_googlecheckout"|"is_recurring"|"is_imported"|"special_to_date"|"custom_design_from"|"custom_design_to"|"news_from_date"|"news_to_date"|"qty"|"min_qty"|"use_config_min_qty"|"is_qty_decimal"|"backorders"|"use_config_backorders"|"min_sale_qty"|"use_config_min_sale_qty"|"max_sale_qty"|"use_config_max_sale_qty"|"is_in_stock"|"low_stock_date"|"notify_stock_qty"|"use_config_notify_stock_qty"|"manage_stock"|"use_config_manage_stock"|"stock_status_changed_automatically"|"use_config_qty_increments"|"qty_increments"|"use_config_enable_qty_increments"|"enable_qty_increments"|"store_id"|"product_type_id"|"product_status_changed"|"product_changed_websites"|"material"|"category_ids"|"image"|"small_image"|"thumbnail"
"TEE BLACK LONG LG"|"28.41"|"25.00"|""|"0.60"|"12.15"|"Ca Cycleworks Lg black cotton longsleeve logo t-shirt Cycleworks Brand Gear!!"|""|"Ca Cycleworks Lg black cotton longsleeve logo t-shirt Cycleworks Brand Gear!! for Ducati Everyone"|" Ducati Everyone"|""|""|"Ca Cycleworks Lg black cotton longsleeve logo t-shirt Cycleworks Brand Gear!!"|"admin"|"base"|"Other Accessories"|"simple"|"0"|"Use config"|""|"Block after Info Column"|""|""|""|"No layout updates"|""|""|""|""|"Enabled"|"None"|"Catalog, Search"|"Yes"|"No"|"Yes"|""|""|""|""|""|"1.0000"|"0.0000"|"1"|"0"|"0"|"1"|"1.0000"|"1"|"0.0000"|"1"|"1"|""|""|"1"|"0"|"1"|"0"|"1"|"0.0000"|"1"|"0"|"0"|"simple"|""|""|""|"36"|"/tee.jpg"|"/tee_sm.jpg"|"/tee_th.jpg"
"LANYARD"|"2.27"|"2.00"|""|"0.05"|"1.05"|"Ca Cycleworks Cycleworks lanyard Cycleworks Brand Gear!!"|""|"Ca Cycleworks Cycleworks lanyard Cycleworks Brand Gear!! for Ducati Everyone"|" Ducati Everyone"|""|""|"Ca Cycleworks Cycleworks lanyard Cycleworks Brand Gear!!"|"admin"|"base"|"Other Accessories"|"simple"|"0"|"Use config"|""|"Block after Info Column"|""|""|""|"No layout updates"|""|""|""|""|"Enabled"|"None"|"Catalog, Search"|"Yes"|"No"|"Yes"|""|""|""|""|""|"1.0000"|"0.0000"|"1"|"0"|"0"|"1"|"1.0000"|"1"|"0.0000"|"1"|"1"|""|""|"1"|"0"|"1"|"0"|"1"|"0.0000"|"1"|"0"|"0"|"simple"|""|""|""|"36"|"/"|"/_sm"|"/_th"
"PVC TAPE"|"13.64"|"12.00"|""|"0.50"|"1.05"|"Ca Cycleworks White pvc duck tape - all 4 panes - 2in x 110yds Cycleworks Brand Gear!!"|""|"Ca Cycleworks White pvc duck tape - all 4 panes - 2in x 110yds Cycleworks Brand Gear!! for Ducati Everyone"|" Ducati Everyone"|""|""|"Ca Cycleworks White pvc duck tape - all 4 panes - 2in x 110yds Cycleworks Brand Gear!!"|"admin"|"base"|"Other Accessories"|"simple"|"0"|"Use config"|""|"Block after Info Column"|""|""|""|"No layout updates"|""|""|""|""|"Enabled"|"None"|"Catalog, Search"|"Yes"|"No"|"Yes"|""|""|""|""|""|"1.0000"|"0.0000"|"1"|"0"|"0"|"1"|"1.0000"|"1"|"0.0000"|"1"|"1"|""|""|"1"|"0"|"1"|"0"|"1"|"0.0000"|"1"|"0"|"0"|"simple"|""|""|""|"36"|"/ductape.jpg"|"/ductape_sm.jpg"|"/ductape_th.jpg"
like image 83
Krista K Avatar answered Nov 12 '22 13:11

Krista K


For those who bored with endless bugs of Magento's out of box Dataflow profiles and considers paid solutions: check this one. With it you simply avoid 99% popular errors raising during importing products with images:

-- no BOM character problem (as it's going to happen through online CSV editor)

-- no "wrong paths" problems (you can set the path where to pick up images in settings, if the image is missing - the log will inform you immediately)

-- no "multiple images" problem: you can import small_image, thumbnail, image fields along with "media_gallery" field containing multiple paths separated by semicolon.

Also, it can EXPORT, so if something goes wrong and you can't figure out what happened - just create your product manually, upload image manually via magento admin, and then just EXPORT this products. It will populate the CSV with proper paths to the images, it will also copy all the required images into the folder that you set in settings as "Media folder". So you can import them back without taking care if the images are in correct folders.

I know most people are looking for free stuff, but if you spent already dozen hours struggling with Dataflow to achieve a simple task of bulk assigning images to the products - I bet you understand what I'm talking about :)

like image 39
Alex Shchur Avatar answered Nov 12 '22 15:11

Alex Shchur