I'm trying to bulk import my product from a .csv. Here is my code so far:
include_once "../app/Mage.php";
include_once "../downloader/Maged/Controller.php";
Mage::init();
// Set the store id
//$app = Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$app = Mage::app('default');
$row = 0;
$categories = array(
'Category 1' => 3,
'Category 2' => 4,
'Category 3' => 5,
'Category 4' => 6,
);
if(($handle = fopen("import.csv", "r")) !== FALSE){
while(($data = fgetcsv($handle, 1000, ';')) !== FALSE){
$simpleProduct->setSku($data[2]);
etc
}
}
The problem is when I save the product the variable is a random string of numbers. Here's my csv.