anybody knows how images appear on “more views” on import?..has anyone successfully done it?..is this solve already on other threads that everyone ignores this question?..any answers will do that lightens up this problem..hope someone will notice this..
The call to addImageToMediaGallery is not specifying all of the possible parameters, and the one for whether to exclude the image or not is defaulting to true.
To have it always enabled, change it to this
foreach ($imageData as $file => $fields) { try { $product->addImageToMediaGallery(Mage::getBaseDir('media') . DS . 'import' . $file, $fields, false, /* move the file or not, default is false */ false); /* exclude or not, default is true */ } catch (Exception $e) {}
The call to addImageToMediaGallery is not specifying all of the possible parameters, and the one for whether to exclude the image or not is defaulting to true.
To have it always enabled, change it to this
foreach ($imageData as $file => $fields) { try { $product->addImageToMediaGallery(Mage::getBaseDir('media') . DS . 'import' . $file, $fields, false, /* move the file or not, default is false */ false); /* exclude or not, default is true */ } catch (Exception $e) {}
joyously you’re a champion!
Steps I took to get multiple image, spreadsheet based imports working.
1. Make changes to Product.php as per joyous’ instructions.
Note: Change the first ‘false’ to ‘true’, it’ll create the usual structured copies of the images in the media/catalog/product directory - you can then remove the originals after the import process.
2. Upload images to /media/import
3. Create a spreadsheet to import as usual
Note: For multiple images per product, create a duplicate line on your spreadsheet with identical information except for the location of the image.
Also: Prefix the image location with a forward slash ‘/’.
4. Import!
...I’ve never spent so long looking for a solution!
Much better than installing a package/extension or fiddling otherwise.
Thanks Anna!
I ran into this same problem, and your solution worked like a charm.
I do want to point out for those of you that have exported the images from one store and are attempting to import those same images to another: You don’t need to go into the csv file to edit out all of the extraneous folder information created by magento during a regular product import (ex: removing /a/a/ from /a/a/image.png). That would simply be too much for some people, and I try to make my life easier when possible.
Here’s what I did:
1) Zip up the products folder located in /www/magento/media/catalog/product
2) Move the product.zip to /www/magento/media/import/
3) Unzip the product.zip folder
4) Move all of the subfolders (of the product folder) to /www/magento/media/import/
5) Go back to the admin, and import all of the products
I’m having an odd problem. Some of my images are working, and some aren’t.
I upload all the products to the media\import folder.
Then I run the Import profile. Some of the product show and some don’t. I can find no reason why some work and some don’t. All images are jpg files. Non have funny characters.
Hi All.... I’m also unable to upload my images via .csv
I have all my pics under /media/import ....... Permissions on these folders are set to 777 ...I also tried setting to 755. I am able to do manually but with 25k in product who’s up for that task????? Not Me..... I believe in a one import method..... . I have read through many threads and have found no answers. I’m currently running 1.1.8 but I ran into this same issues with 1.1.7 .
For those of you who are having problems importing images via CSV, I had no trouble with that today. Have a look at my post at the bottom of this thread.
gbarclays code modification helped me with importing images. All my permissions were correct. But the code in the file he mentioned was set to false.. so the imports were never done.
Since I put all my images in my data to import as just the file name AND I placed them all in the media/import folder.
It doesn’t make sense to have to populate the data with a slash in front of all those product names.
I think this is a better bug fix becuase now I can still use paths if I put images into say media/import/store1 and media/import/store2
I jsut do not put the preceeding slash in teh very front of my image paths in my data
so now in my import data the image paths would be like
imagename1.jpg
store1/imagename.jpg
moreimages/imagename.jpg
and so on.
hope that helps for those who jsut have all their images lumped into one folder. It sure helped me.
Thank you gbarclay for figuring out where the problem was.
is could be a quite confusing bug, especially for new people on magento… ok i think the most people have a .jpg extension but for someone who have a .JPG is quite difficult to understand why images seems to be broken....