Watch for an event like this:
<config>
<global>
<events>
<sales_order_place_after>
<observers>
<yourmodule_order_place_after>
<class>yourmodule/observer</class>
<method>onSalesOrderPlaceAfter</method>
</yourmodule_order_place_after>
</observers>
</sales_order_place_after>
</events>
</global>
</config>
Next, you need something to handle the event.
app/code/local/Yourcompany/Yourmodule/Model/Observer.php
<?php
class Yourcompany_Yourmodule_Model_Observer {
public function onSalesOrderPlaceAfter($observer) {
$order = $observer->getOrder();
/* @var $item Mage_Sales_Model_Order_Item */
foreach ($order->getItemsCollection() as $item) {
// Do something with $item here...
$name = $item->getName();
$price = $item->getPrice();
$sku = $item->getSku();
}
}
}
See the database table "sales_flat_order_item" or do a var_dump($item->debug())
to see what sort of values are available. As it's a flat table the only way to find more information about a product is like this:
$product = Mage:getModel('catalog/product')->load($item->getProductId());
$product->getDescription();