$customer = Mage::getModel('customer/customer')->load(1); // load customer with ID 1 $customerData = $customer->getData(); // get all data for the customer echo $customerData['firstname']; // output the customer's first name
$product = Mage::getModel('catalog/product')->load(2); // load product with ID 2 $productData = $product->getData(); // get all data for the product echo $productData['name']; // output the product's nameThis example uses getData() to retrieve all the data fields for a product with the ID of 2, then outputs the product's name. Package Library: Magento Core Library.