Wednesday 10 April 2013

get Invoice data magento


$orders_invoice = Mage::getModel("sales/order_invoice")->getCollection(); 
      foreach($order_invoice as $val){
           $invoice = $val->getData();
           $order = Mage::getModel('sales/order')->load($invoice["order_id"]);
           $orderdata = $order->getData();
           $totaldue = $orderdata['total_due'];
           $grandtotal = $orderdata['grand_total'];
           $status = ($totaldue == 0) ? 'Paid':'unpaid';
           $order->getStatusLabel();
           $cfirstname = $orderdata['customer_firstname'];
           $clastname = $orderdata['customer_lastname'];
           $increment_id = $orderdata['increment_id'];
    }

2 comments:

Unknown said...


Magento Integration is quite tricky and complicated

Anonymous said...

This is not working.