I want order id in observe function but I am getting null I am using this code Observe.php

public function invoiceexport(Varien_Event_Observer $event=null){
    $_helper = Mage::helper('Nino_invoiceexport');
    $importStartDateTime = date('Y-m-d H:i:s');
    $orders = $event->getOrder();

My config.xml is as :


1 Answer 1


You can get orderId by using this way,

    $invoice = $observer->getEvent()->getInvoice();
    $order = $invoice->getOrder();
  • thanks Keyur one more things t want a customer id. how can i get this.
    – Piyush
    Nov 13, 2017 at 11:46
  • $order->getCustomerId() it will return if customer is exist in your webshop @Piyush
    – Keyur Shah
    Nov 13, 2017 at 12:40

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.