Try the Demo

Magento Forum

   
Lost links to existing images when importing new products
 
canuckcrafts
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2012-05-18
 

I hope someone can help me solve this one!

I was importing data in batches to build the database ... the images would not link in the import so I manually edited each one in the Product Manager to display and assigned the Base, Small and Thumbnail settings ... all was going well.

I then did a complete export of data and added some items to the end of the file in the appropriate columns. When I re-imported it wiped out hte links to the images, even though the path was in the file just as it was exported using the Magento Export tool…

I have wasted two days trying to get this working smoothly, and just when I figured I had it .... boom!

Anyone know if the links can be re-established? I don\\\\\\\’t want to go into each product and upload the images again as they are already on the site.

Any help would be appreciated.

Allan

 Signature 

Canuck Craft Distributing Inc.
Canuck Crafts Website

 
Magento Community Magento Community
Magento Community
Magento Community
 
MrFeelgood
Jr. Member
 
Avatar
Total Posts:  20
Joined:  2010-03-01
Leeuwarden
 

As far as I know the path to the images should NOT be the same as the path exported, because the import tool looks for images in the media/import/ folder without the alphabetic folders like: /a/a/. you could replace this with regex: Replace ^/[a-z]/[a-z]/ with /. You you’ll work it out!

 Signature 

Magento webshops by Impulse Webdesign Leeuwarden

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mistys
Jr. Member
 
Total Posts:  3
Joined:  2012-02-09
 

I am needing help with this too.  I have read and re-read potential solutions and instructions for days on solving this issue.  I have made media/import folder.  I have magento version 1.7.  I also renamed my images files and just placed / in front of it /image-file.jpg.  I also added the “_1” (really don’t need to cause magento does it for me) and even “image”, “small” , and “thumbnail”.  Every time I import new products, all my existing images goes blank.  When I clean out the catalog/product/cache the images disappears on the front end.  I have 2 stores.  I am just at my wits end on how to import new products/images without wiping out the existing images.  I been importing/exporting through dataflow.  That’s another thing, I see import, export, dataflow in backend system menu.  That confuses me on which one i should use.

Michelle

 
Magento Community Magento Community
Magento Community
Magento Community
 
roy_russo
Jr. Member
 
Total Posts:  2
Joined:  2010-04-26
 

In app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

move line 1226 two lines up (inside the if statement ) so the new code will be

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
    
$rowData[$imageCol] $uploadedGalleryFiles[$rowData[$imageCol]];
}

This will not fix all the problems, but at least I can now import my products if they already have images.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bc28001
Jr. Member
 
Total Posts:  16
Joined:  2011-08-08
 
roy_russo - 04 June 2012 02:11 PM

In app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php

move line 1226 two lines up (inside the if statement ) so the new code will be

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
    
$rowData[$imageCol] $uploadedGalleryFiles[$rowData[$imageCol]];
}

This will not fix all the problems, but at least I can now import my products if they already have images.

Chief i have magento 1.7 and i was having the same problem .
and thanks to your solution i got my issue fixed.
ok thanks so much

 
Magento Community Magento Community
Magento Community
Magento Community
 
roy_russo
Jr. Member
 
Total Posts:  2
Joined:  2010-04-26
 

I think I have succeeded to solve the bug in a better way.
Now new images can be imported, and old images keep their values.

if (!array_key_exists($rowData[$imageCol]$uploadedGalleryFiles)) {
    $uploadedGalleryFiles[$rowData[$imageCol]] 
$this->_uploadMediaFiles($rowData[$imageCol]);
}
// if images are new, the raw data should be the new image file
// if images are already loaded,  should not be called
if (substr_count($rowData[$imageCol]'/') == 1{
    $rowData[$imageCol] 
$uploadedGalleryFiles[$rowData[$imageCol]];                        
}

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top