Ads

Tuesday, June 22, 2010

Getting Ordered Items and their Detail from Order ID in Magento

$order = Mage::getModel('sales/order')->load($order_id);
$items = $order->getAllItems();
$itemcount=count($items);
$name=array();
$unitPrice=array();
$sku=array();
$ids=array();
$qty=array();
foreach ($items as $itemId => $item)
{
$name[] = $item->getName();
$unitPrice[]=$item->getPrice();
$sku[]=$item->getSku();
$ids[]=$item->getProductId();
$qty[]=$item->getQtyToInvoice();
}

No comments:

Post a Comment