I want to send invoice to customer after they place an order using the "Bank Transfer" method.
It only sends the invoice one the payment is "taken" but I want to send the invoice as soon as the order is placed. Any ideas?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.Sign up to join this community
You would need to create an observer on
sales_order_place_after and check the payment method (or use the module's observer if they have a custom one)
Then you can create the invoice:
$capture = Mage_Sales_Model_Order_Invoice::NOT_CAPTURE; /** @var Mage_Sales_Model_Order_Invoice $invoice */ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice(); $invoice->setRequestedCaptureCase($capture); $invoice->register(); $transaction = Mage::getModel('core/resource_transaction') ->addObject($invoice) ->addObject($invoice->getOrder()); $transaction->save();