0

Im want to import my products from a .txt file. So far no problem. The only issue i have is that i cant link my product with an image ( i have already imported in media/import )

        $data = array(
        array(
            'sku' => $artikel_nr,
            '_product_websites' => array('web1','web2'),
            '_attribute_set' => convertCategorie($category)[2], // siehe auch in Kategorie tabelle
            '_type' => 'simple',
            'ean' =>  $ean_nr,
            'price' => $preis,
            'name' => $prodkttitel." ".$farbe,
            'description' => 'default',
            'short_description' => $prodkttitel,
            'long_description' => $short_description,
            ...
            '_media_image' => $artikel_nr.".jpg",
            '_media_is_disabled' => 1,
            'image' => $artikel_nr.".jpg",
            '_media_lable' => $artikel_nr.' image',
            '_media_position' => 1,
            '_media_attribute_id' => Mage::getSingleton('catalog/product')->getResource()->getAttribute('media_gallery')->getAttributeId(),
            'small_image' => $artikel_nr.".jpg",
            'thumbnail' => $artikel_nr.".jpg",


        )

    );

my images are named after the sku and i already have them in the media/import. the import is not throwing any exceptions but i cant see any pictures loaded into the produkt.

    $import = Mage::getModel('fastsimpleimport/import');
try {

    $import = Mage::getModel('fastsimpleimport/import');
    $import
    ->setUseNestedArrays(true)
    ->processProductImport($data);
} catch (Exception $e) {
    print_r($import->getErrorMessages());
}
1

I had the same problem. Resolved by setting 777 permission to /media/import directory (and all the files into). After the import set 777 to all /catalog/product/images then reindex and flush cache.

  • I can't see an issue with the poster's code, so it's my assumption too that the images cannot be read. – Andreas von Studnitz Feb 3 '17 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.