$product = Mage::getModel('catalog/product'); $product->setName('Test Product'); $product->setSku('test-product'); $product->setPrice(9.99); $product->setAttributeSetId(4); $product->save();
$product = Mage::getModel('catalog/product')->load(123); $product->setName('Updated Product Name'); $product->setDescription('This is the updated product description.'); $product->save();
$product = Mage::getModel('catalog/product')->load(123); $name = $product->getName(); $sku = $product->getSku(); $price = $product->getPrice();This code loads an existing product with ID 123 and retrieves its name, SKU, and price using getter methods. These values can then be used elsewhere in the application. In summary, the `Mage_Catalog_Model_Product` class provides a powerful set of methods for creating, updating, and retrieving products within Magento. It is part of the Catalog package library within Magento.