0

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?

1 Answer 1

1

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)

1
  • Thank you for directing me! I will let you know how it went once I go through it and will accept the answer!
    – Greg
    Commented Jul 7, 2017 at 14:16

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.