Raveinfosys_Deleteorder - Version 1.0.6

Version Notes

This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7, 1.8, 1.9.0.1;
In this particular version we are supporting it to run on PHP V 5.5.15

Download this release

Release Info

Developer Rave Infosys
Extension Raveinfosys_Deleteorder
Version 1.0.6
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.6

app/code/community/Raveinfosys/Deleteorder/controllers/Adminhtml/DeleteorderController.php CHANGED
@@ -32,9 +32,11 @@ class Raveinfosys_Deleteorder_Adminhtml_DeleteorderController extends Mage_Admin
32
  public function deleteAction() {
33
  if($order = $this->_initOrder()) {
34
  try {
35
- $order->delete()->save();
36
- Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Order was successfully deleted'));
37
- $this->_redirectUrl(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));
 
 
38
  } catch (Exception $e) {
39
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
40
  $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('order_ids')));
@@ -49,7 +51,8 @@ class Raveinfosys_Deleteorder_Adminhtml_DeleteorderController extends Mage_Admin
49
  } else {
50
  try {
51
  foreach ($deleteorderIds as $deleteorderId) {
52
- Mage::getModel('sales/order')->load($deleteorderId)->delete();
 
53
  }
54
  Mage::getSingleton('adminhtml/session')->addSuccess(
55
  Mage::helper('adminhtml')->__(
@@ -62,4 +65,24 @@ class Raveinfosys_Deleteorder_Adminhtml_DeleteorderController extends Mage_Admin
62
  }
63
  $this->_redirectUrl(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
32
  public function deleteAction() {
33
  if($order = $this->_initOrder()) {
34
  try {
35
+ $order->delete();
36
+ if($this->_remove($this->getRequest()->getParam('order_id'))){
37
+ Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Order was successfully deleted'));
38
+ $this->_redirectUrl(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));
39
+ }
40
  } catch (Exception $e) {
41
  Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
42
  $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('order_ids')));
51
  } else {
52
  try {
53
  foreach ($deleteorderIds as $deleteorderId) {
54
+ Mage::getModel('sales/order')->load($deleteorderId)->delete()->unsetAll();
55
+ $this->_remove($deleteorderId);
56
  }
57
  Mage::getSingleton('adminhtml/session')->addSuccess(
58
  Mage::helper('adminhtml')->__(
65
  }
66
  $this->_redirectUrl(Mage::helper('adminhtml')->getUrl('adminhtml/sales_order/index'));
67
  }
68
+
69
+ public function _remove($order_id){
70
+ $resource = Mage::getSingleton('core/resource');
71
+ $delete = $resource->getConnection('core_read');
72
+ $order_table = $resource->getTableName('sales_flat_order_grid');
73
+ $invoice_table = $resource->getTableName('sales_flat_invoice_grid');
74
+ $shipment_table = $resource->getTableName('sales_flat_shipment_grid');
75
+ $creditmemo_table = $resource->getTableName('sales_flat_creditmemo_grid');
76
+ $sql = "DELETE FROM " . $order_table . " WHERE entity_id = " . $order_id . ";";
77
+ $delete->query($sql);
78
+ $sql = "DELETE FROM " . $invoice_table . " WHERE order_id = " . $order_id . ";";
79
+ $delete->query($sql);
80
+ $sql = "DELETE FROM " . $shipment_table . " WHERE order_id = " . $order_id . ";";
81
+ $delete->query($sql);
82
+ $sql = "DELETE FROM " . $creditmemo_table . " WHERE order_id = " . $order_id . ";";
83
+ $delete->query($sql);
84
+
85
+ return true;
86
+ }
87
+
88
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Raveinfosys_Deleteorder</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
@@ -10,10 +10,10 @@
10
  <description>Magento doesn't allow you to delete orders. You can only mark it to cancelled but you can't delete it. This extension allows you to seamlessly delete any order. We have provided three options to delete any order. 1) option to delete any order from the order list page, 2) option to delete any order from the order page, 3) option to delete mass order from the order list page. </description>
11
  <notes>This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7, 1.8, 1.9.0.1;&#xD;
12
  In this particular version we are supporting it to run on PHP V 5.5.15</notes>
13
- <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>lpext@raveinfosys.com</email></author></authors>
14
- <date>2014-08-04</date>
15
- <time>05:54:23</time>
16
- <contents><target name="magecommunity"><dir name="Raveinfosys"><dir name="Deleteorder"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="9d3870026701ef1250c7cf2d50d8e5bf"/><dir name="Render"><file name="Delete.php" hash="f2b03ab25c61f1af2bf2149c72eb8405"/></dir><file name="View.php" hash="927f52f9bdee13b6a9db09fb2830f2cc"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c169154213a43dffd8e20c11db9b4085"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeleteorderController.php" hash="f5f2c4ed5f3ce68c9233e4a967ae9ed5"/></dir></dir><dir name="etc"><file name="config.xml" hash="1da7a12e990885aa7318ec995bad0c58"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Deleteorder.xml" hash="1d73a901977f08e90563dd8c5c8adb64"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="deleteorder.xml" hash="7d07207d7c1103b44526c9344d593354"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>5.5.15</max></php></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Raveinfosys_Deleteorder</name>
4
+ <version>1.0.6</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
10
  <description>Magento doesn't allow you to delete orders. You can only mark it to cancelled but you can't delete it. This extension allows you to seamlessly delete any order. We have provided three options to delete any order. 1) option to delete any order from the order list page, 2) option to delete any order from the order page, 3) option to delete mass order from the order list page. </description>
11
  <notes>This version is properly tested on the following Magento CE versions: 1.5, 1.6, 1.7, 1.8, 1.9.0.1;&#xD;
12
  In this particular version we are supporting it to run on PHP V 5.5.15</notes>
13
+ <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>magento@raveinfosys.com</email></author></authors>
14
+ <date>2014-08-18</date>
15
+ <time>11:55:52</time>
16
+ <contents><target name="magecommunity"><dir name="Raveinfosys"><dir name="Deleteorder"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="9d3870026701ef1250c7cf2d50d8e5bf"/><dir name="Render"><file name="Delete.php" hash="f2b03ab25c61f1af2bf2149c72eb8405"/></dir><file name="View.php" hash="927f52f9bdee13b6a9db09fb2830f2cc"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="c169154213a43dffd8e20c11db9b4085"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeleteorderController.php" hash="5fd6536b41a3785ed36cc1a92efb6849"/></dir></dir><dir name="etc"><file name="config.xml" hash="1da7a12e990885aa7318ec995bad0c58"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Deleteorder.xml" hash="1d73a901977f08e90563dd8c5c8adb64"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="deleteorder.xml" hash="7d07207d7c1103b44526c9344d593354"/></dir></dir></dir></dir></target></contents>
17
  <compatible/>
18
  <dependencies><required><php><min>5.2.0</min><max>5.5.15</max></php></required></dependencies>
19
  </package>