AvS_FastSimpleImport

Wrapper for Magento ImportExport functionality which imports data from arrays

View the Project on GitHub avstudnitz/AvS_FastSimpleImport

Category-Product Relation Import

You can import the categories which a product is in with the product import by using the column "_category". This has some limitations though:

For this there is a seperate import with which you can import those relations.

Example Code

$data = array();
$data[] = array(
    '_root' => 'Default Category',
    '_category' => 'Test2',
    '_sku' => '4711',
    'position' => 1
);
$data[] = array(
    '_root' => 'Default Category',
    '_category' => 'Test2',
    '_sku' => '0815',
    'position' => 2
);
$data[] = array(
    '_root' => 'Default Category',
    '_category' => 'Test2/Test3',
    '_sku' => '0815',
    'position' => 1
);

/** @var $import AvS_FastSimpleImport_Model_Import */
$import = Mage::getModel('fastsimpleimport/import');
try {
    $import->processCategoryProductImport($data);
} catch (Exception $e) {
    print_r($import->getErrorMessages());
}