Wednesday, 2 October 2013

delete existing order from invoice,shipment,credit memo.

http://www.magentocommerce.com/magento-connect/orders-eraser.html using of this extension you may delete order from sales > order> grid ,but if you want to delete same existing order id from invoice, shipment, creditmemo grid you have to customize little more in this extension.

For this you may change in function _erase2($orderId) in(\app\code\community\Wyomind\Orderseraser\Model\Orderseraser.php)
add below code:

$tablesfig = $resource->getTableName('sales_flat_invoice_grid');
$tablesfsg = $resource->getTableName('sales_flat_shipment_grid');
$tablesfcg = $resource->getTableName('sales_flat_creditmemo_grid');


$sql = "DELETE FROM " . $tablesfig . " WHERE order_id     = " . $orderId . ";";
$delete->query($sql);
$sql = "DELETE FROM " . $tablesfsg . " WHERE order_id     = " . $orderId . ";";
$delete->query($sql);
$sql = "DELETE FROM " . $tablesfcg . " WHERE order_id     = " . $orderId . ";";
$delete->query($sql);
      

No comments:

Post a Comment