Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Import/Export in 1.5 - Image / Multi-Line Category Issues [SOLVED]
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Has anyone had any luck with Magento’s built in import/export in 1.5?

If I import one product, it works just fine (although it doesn’t pull the image, I think I still have that pointing wrong).

However, if I import the whole file (around 40 entries) it gives me no errors, and says it’s successful, yet when I go to the actual product list none of them are there.

Any ideas what is happening here?

I haven’t needed this functionality in quite some time, I know I had it working on one of the versions awhile back.

I did figure out that the import error only happens when more than category is included. I have the categories formatted exactly the same as the export file, so in theory it should be working.

Having multiple images does not throw it off; however, they are still not importing so the linking is still wrong there.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ArmandoR
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-08-21
Caldwell, Idaho, U.S.A.
 

Just wanted to clarify that you have the images in media/import and that you have a leading slash in your CSV file — /someimage.png.

 
Magento Community Magento Community
Magento Community
Magento Community
 
phlux0r
Member
 
Avatar
Total Posts:  73
Joined:  2008-03-09
Auckland, New Zealand
 

I have successfully imported products with M1.5.

Multiple categories work, I have the ID\’s comma separated like so: \"2,6,24,198\"
To have the products show up after import, you need to make sure that the store column is \"admin\" and the websites column has the exact website code of your website you are importing to - in my case it\’s \"base\".

HTH

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

Do you try to reindex after import?

php -f shell/reindex.php

Please take a look of http://www.magentocommerce.com/boards/viewthread/227005/ there are some reindex/refresh cache options in my script…

Regards!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

@Armando Yes, I do have the /someimage.png format.

@phlux04 Are you using profiles still? I’m using the new import/export feature and it wants the categories spelled out on their own lines. If you enter the IDs like that, it can’t find them.

@amartinez Yes, I did reindex after the import. It didn’t seem to help.

I’m now on 1.5.1.0 as I noticed there were some changes to the import/export system, but am still having the same results ... or lack thereof.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Alright, for whatever reason my .csv file was NOT saving correctly from Excel even tho I had set it to UTF-8. I opened it in Notepad and re-saved it without changing anything else and now the category issue is GONE.

However, it\’s still not grabbing the images.

They are all in media/import.

The file name case is correct in the .csv.

They have a forward slash before the name in the .csv.

I even tried the external image import method from here: http://www.magentocommerce.com/boards/viewthread/6947/P45/#t302849

Any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

I put my images under media/catalog/product/img_articulos/

Then fill my csv fields like: “/img_articulos/test1.jpg”

Do you test the script I mentioned before?

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

about utf-8 issues, you can convert your files thought notepad++ (windows) or iconv (linux/mac)

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

@amartinez Shoot. I had no idea the image import location changed. Moving my images to media/catalog/product totally did the trick. Thank you so much!

I did take a look at your script but I really wanted to be able to utilize the native system without modifications if at all possible, and now I can.

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

great!

and about my script it does not change the magento way… extends it! smile

I think you should use when:

- you have 150,000+ products
- you want to update your store daily (automatically, via crontab)

regards!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Oh okay, that makes sense. This store only has about 630 products and they don’t get updated at the same time. The import took about 20 seconds, literally.

Thanks for your help! I’m usually pretty solid with these things, but it’s just been so long since I used the import/export functionality!

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Okay so this is really weird—I thought the images were working because they show up in thumbnails in the Catalog > Manage Products grid (this installation has TBT Enhanced Grid on it), BUT if you click on the product to edit it in the admin, no images show up in the Images tab. They don’t show up on the frontend either.

Also, I checked out the media/catalog/products folders and it never copied the images into them, which is clearly what’s causing the problem.

I’m not sure how it’s still finding them for the thumbnail in the admin since it won’t pull them anywhere else.

Any ideas why it wouldn’t be copying them over? The media folder is set to 755.

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

I think that you cannot use the 1.5 ImportExport script to make your images show in admin (do you need it?), but you can use advanced profiles instead. Please try with http://www.magentocommerce.com/wiki/3_-_store_setup_and_management/import_export/how_to_automatically_import_simple_grouped_and_configurable_products

Edit app/code/local/Mage/Catalogimport/Model/Productcategory.php, uncomment:

/**
            * if ( in_array( $field, $this -> _imageFields ) ) {
            * continue;
            * }
            */

and

/**
        * uncomment to use magento image system (and allow to: edits via admin, change images)
        * $imageData = array();
        * foreach ( $this -> _imageFields as $field ) {
        * if ( !empty( $data[$field] ) && $data[$field] != 'no_selection' ) {
        * if ( !isset( $imageData[$data[$field]] ) ) {
        * $imageData[$data[$field]] = array();
        * } 
        * $imageData[$data[$field]][] = $field;
        * } 
        * } 
        * 
        * foreach ( $imageData as $file => $fields ) {
        * try {
        * $product -> addImageToMediaGallery( Mage :: getBaseDir( 'media' ) . '/catalog/product' . $file, $fields, false );
        * } 
        * catch ( Exception $e ) {
        * } 
        * } 
        * 
        * if ( !empty( $data['gallery'] ) ) {
        * $galleryData = explode( ',', $data["gallery"] );
        * foreach( $galleryData as $gallery_img ) {
        * try {
        * $product -> addImageToMediaGallery( Mage :: getBaseDir( 'media' ) . '/catalog/product' . $gallery_img, null, false, false );
        * } 
        * catch ( Exception $e ) {
        * } 
        * } 
        * }
        */

but caution! every import your cache folder with increase with more and more image duplicates!

luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
sherrie
Mentor
 
Avatar
Total Posts:  1655
Joined:  2007-12-14
Waterloo, ON
 

Ahhhh, you’re right. That’s cool, I just made a profile that had nothing except sku and image information and uploaded it as well, without modifying that file. All went well.

smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
amartinez
Guru
 
Avatar
Total Posts:  347
Joined:  2008-11-14
Spain
 

HI again! I have good news!

I am pleased to inform you that my free extension \”AMartinez_CustomImportExport\" can now export as well.

It\’s the first step to future functionalities. About your problem: you can easily export - search&replace;- then import again smile

Feel free to test it and report any issue or suggestion!

 
Magento Community Magento Community
Magento Community
Magento Community
 
fischo
Jr. Member
 
Total Posts:  11
Joined:  2011-04-13
 
Armando at AAMC - 26 April 2011 01:53 PM

Just wanted to clarify that you have the images in media/import and that you have a leading slash in your CSV file — /someimage.png.

THANK YOU FOR leading slash in your CSV file — /someimage.png !!!

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2