cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Importing Products (Image does not exist error), please help

Question about Importing Products (Image does not exist error), please help

So you can see the image below:

http://i.imgur.com/AWlf2ng.jpg

I am trying to self-learn the import/export process.  I am migrating from a different store (ProductCart to Magento), and before I am can import the 400+ products from the other store, I am getting a feel for importing and exporting the Magento way.  

So I manually created about 12 products just for testing purposes in the Magento store, and I export them using System>Import/Export>Dataflow Profiles.  I export Product Stocks, and then attempt to re-import the Product Stocks.  

But even just making minor changes to the spreadsheet (such as duplicating products to test importing), I still get the Image does not exist error - and as you can see on the spreadsheet and image paths, everything is in place as they should be:

http://i.imgur.com/AWlf2ng.jpg

So like I said I am just testing the import/export, and once I get it error-free, I will try to import the product data from the other store, which has basic info compared to Magento (just SKU, price, description, name, image path)

Any help would be GREATLY appreciated.

2 REPLIES

Re: Question about Importing Products (Image does not exist error), please help

Hello.

 

According to Magento images hierarchy after the upload  images are stored in media/catalog/product directory and next 2 subfolders on the basis of image name are created.

 

You see, if you exported the file with images from one Magento, you will have in spreadsheet the images in this format - 2/0/2008image_name.jpg in case picture is entitled ‘2008image_name’.

 

However, this is path to images is created in your first Magento. If you use this file to import to other database, your images should be physically stored in media/import folder and in your import file you need to have image name with leading slash like - /2008image_name.jpg

 

Importing data to other store, Magento import/export looks for images info in media/import folder of that store.

 

Here is also the article with more details - https://www.mag-manager.com/useful-articles/tipstricks/the-procedure-of-magento-images-import/

--------

Store Manager for Magento 1.x and 2.x - inventory management tool to automatically update products, customers, orders, and other data across multiple sales channels and suppliers.

Re: Question about Importing Products (Image does not exist error), please help

This is my template file

sku,image

product-001,/imagefilename.jpg

This Mage_Catalog_Model_Convert_Adapter_Product class will process this file by function saveImageDataRow

/**
     * Save data row with gallery image info only
     *
     * @param Mage_Catalog_Model_Product $product
     * @param array $importData
     *
     * @return Mage_Catalog_Model_Convert_Adapter_Product
     */
    public function saveImageDataRow($product, $importData)
    {
        $imageData = array(
            'label'         => $importData['_media_lable'],
            'position'      => $importData['_media_position'],
            'disabled'      => $importData['_media_is_disabled']
        );

        $imageFile = trim($importData['_media_image']);
        $imageFile = ltrim($imageFile, DS);
        $imageFilePath = Mage::getBaseDir('media') . DS . 'import' . DS . $imageFile;

        $updatedFileName = $this->_galleryBackendModel->addImage($product, $imageFilePath, null, false,
            (bool) $importData['_media_is_disabled']);
        $this->_galleryBackendModel->updateImage($product, $updatedFileName, $imageData);

        $this->_addAffectedEntityIds($product->getId());
        $product->setIsMassupdate(true)
            ->setExcludeUrlRewrite(true)
            ->save();

        return $this;
    }

as you can see, the image file path defined by this line:

$imageFilePath = Mage::getBaseDir('media') . DS . 'import' . DS . $imageFile;

That means, you will have to place your image into media/import folder to make sure that the file exists, if not, there will be an exception thrown by this class

Mage_Catalog_Model_Product_Attribute_Backend_Media
if (!$file || !file_exists($file)) {
            Mage::throwException(Mage::helper('catalog')->__('Image does not exist.'));
}

You can check more detail here: how to fix images does not exist when importing magento products