Magento do something when Order is Complete

Do something when any order is complete or invoice paid by Magento observer

$order = $observer->getOrder();
if($order->getState() == Mage_Sales_Model_Order::STATE_COMPLETE){
    //after order complete codes
    }

or

$invoice = $observer->getEvent()->getInvoice();
    if($invoice->getState() == Mage_Sales_Model_Order_Invoice::STATE_PAID){
            //afterInvoice Paid codes
    }

Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *