I`m fetching invoice collection using Mage::getModel('sales/order_invoice')->getCollection(); but I also want Order number, payment method and customer name according to the invoice number. How to fetch that and display in grid?

1 Answer 1


Please find the below answer to get order number,order information,payment method and customer name based on invoice id --


$invoiceid =15;

/* get invoice collection  */
$invoicecollection = Mage::getModel("sales/order_invoice")->getCollection()

/* get order number and collection with customer name */
$orderId = $invoicecollection[0]['order_id'];
$order = Mage::getModel('sales/order')->load($orderId);

//echo "<pre>"; print_r($order->getData());
echo $order->getCustomerFirstname();

/* get payment information and card type */
$payment = $order->getPayment();
//echo "<pre>"; print_r($payment->getData());
echo $payment['cc_type'];

//Get Payment Info
echo $payment->getMethodInstance()->getCode();
echo $payment->getMethodInstance()->getTitle(); 

  • This might be correct but what I`m looking is for to fetch the order number, customer name and payment method according to invoice number on admin panel grid! Jun 26, 2018 at 23:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.