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?

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();

(source: How to create unpaid invoice programmatically)

  • Thank you for directing me! I will let you know how it went once I go through it and will accept the answer! – Bare Feet Jul 7 '17 at 14:16

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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