diff --git a/src/app/code/community/Fontis/EwayAu/Model/Direct.php b/src/app/code/community/Fontis/EwayAu/Model/Direct.php
index a0cd30a..1dadf4b 100644
--- a/src/app/code/community/Fontis/EwayAu/Model/Direct.php
+++ b/src/app/code/community/Fontis/EwayAu/Model/Direct.php
@@ -374,26 +374,4 @@ public function parseXmlResponse($xmlResponse)
return $newResArr;
}
-
- /**
- * Check if invoice email can be sent, and send it
- *
- * @param Mage_Sales_Model_Order_Invoice $invoice
- * @param Mage_Sales_Model_Order_Payment $payment
- * @return Fontis_EwayAu_Model_Direct
- */
- public function processInvoice($invoice, $payment)
- {
- parent::processInvoice($invoice, $payment);
- try {
- $storeId = $invoice->getOrder()->getStoreId();
- if (Mage::helper('sales')->canSendNewInvoiceEmail($storeId)) {
- $invoice->save();
- $invoice->sendEmail();
- }
- } catch (Exception $e) {
- mage::logException($e);
- }
- return $this;
- }
}
diff --git a/src/app/code/community/Fontis/EwayAu/Model/Observer.php b/src/app/code/community/Fontis/EwayAu/Model/Observer.php
new file mode 100644
index 0000000..cf5140e
--- /dev/null
+++ b/src/app/code/community/Fontis/EwayAu/Model/Observer.php
@@ -0,0 +1,54 @@
+getOrder();
+ if ($order->hasInvoices()) {
+ foreach ($order->getInvoiceCollection() as $invoice) {
+ // email out the invoices
+ try {
+ $storeId = $invoice->getOrder()->getStoreId();
+ if (Mage::helper('sales')->canSendNewInvoiceEmail($storeId)) {
+ $invoice->sendEmail();
+ }
+ } catch (Exception $e) {
+ mage::logException($e);
+ }
+ }
+ }
+ return $this;
+ }
+
+}
diff --git a/src/app/code/community/Fontis/EwayAu/etc/config.xml b/src/app/code/community/Fontis/EwayAu/etc/config.xml
index 3f7a550..ca4a664 100644
--- a/src/app/code/community/Fontis/EwayAu/etc/config.xml
+++ b/src/app/code/community/Fontis/EwayAu/etc/config.xml
@@ -74,6 +74,17 @@
+
+
+
+
+ singleton
+ ewayau/observer
+ checkout_submit_all_after
+
+
+
+