$itemcount = 0; $order = Mage::getModel('sales/order')->load($order_id); $items = $order->getAllItems(); $itemcount=count($items); $name=array(); $unitPrice=array(); $sku=array(); $ids=array(); $qty=array(); if($itemcount > 0){ foreach ($items as $itemId => $item) { $name[] = $item->getName(); $unitPrice[]=$item->getPrice(); $sku[]=$item->getSku(); $ids[]=$item->getProductId(); $qty[]=$item->getQtyToInvoice(); } }
It is worked only for simple products
ReplyDelete