I want to add Commission junction to my client site, in that they asked for each product sku\'s and price. After the confirmation page/ success page only we need to pass the
Watch for an event like this:
yourmodule/observer
onSalesOrderPlaceAfter
Next, you need something to handle the event.
app/code/local/Yourcompany/Yourmodule/Model/Observer.php
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();