$product = Mage::getModel('catalog/product'); $product->setSku('test-product'); $product->setName('Test Product'); $product->setPrice(10.99); $product->setId(1234); //Set product ID $product->save();
$product = Mage::getModel('catalog/product')->load(1234); $product->setName('New Product Name'); $product->setDescription('New product description'); $product->setId(1234); //Set product ID $product->save();In both examples, the setId method is used to set the product ID to 1234. The package library used in these examples is Magento's catalog module.