Skip to content

Commit

Permalink
Throw exception when editing an order and the old order could not be …
Browse files Browse the repository at this point in the history
…cancelled. (#1170)

This is to avoid having 2 open orders.
  • Loading branch information
woutersamaey authored Sep 1, 2020
1 parent 54ea236 commit a985746
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -1549,6 +1549,10 @@ public function createOrder()
$service->setOrderData($orderData);

$oldOrder->cancel();

if(!$oldOrder->isCanceled()){
Mage::throwException('Could not cancel the old order during order edit.');
}
}

/** @var Mage_Sales_Model_Order $order */
Expand Down

0 comments on commit a985746

Please sign in to comment.