i am trying to get customer's sku through product id but m not able to get it till now. i have tried a code which brings the sku but it does not bring all products which a customer has purchased
// Create order collection object $orders = Mage::getResourceModel('sales/order_collection')->addFieldToSelect('*')->addFieldToFilter('customer_id', $custId);
$order_id= $orders->getFirstItem()->getId();
$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)
{
echo"<h5>You have following:". $name[] = $item->getName()."</h5>";
$unitPrice[]=$item->getPrice();
echo"<h5>SKU of your Products:" .$sku[]=$item->getSku()."</h5>";
echo"<h5>You have following:".$ids[]=$item->getProductId()."</h5>";
echo"<h5>You have following:".$qty[]=$item->getQtyToInvoice()."</h5>";
}
echo "<h4>Payment Details :</h4>";
}
?>
`