Skip to content

Commit

Permalink
Fix to work with mage 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
broopdias committed Dec 14, 2022
1 parent a407442 commit bc5bde8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Controller/Adminhtml/Order/MassOrderShip.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ public function execute()
}
}

try {
// Save created shipment
$saveTransaction->save();

// Send email
if ($notify) {
foreach ($shipmentArray as $shipment) {
$this->shipmentNotifier->notify($shipment);
if (!empty($shipmentArray)) {
try {
// Save created shipment
$saveTransaction->save();

// Send email
if ($notify) {
foreach ($shipmentArray as $shipment) {
$this->shipmentNotifier->notify($shipment);
}
}
}
if (!empty($shipmentArray)) {
$ordersIncrementIds = implode(",", array_keys($shipmentArray));
$this->messageManager->addSuccess(__("Shipment Succesfully Generated for orders: ".$ordersIncrementIds));
} catch (\Exception $e) {
$this->messageManager->addError(__('Cannot ship order'. $e->getMessage()));
}
} catch (\Exception $e) {
$this->messageManager->addError(__('Cannot ship order'. $e->getMessage()));
}
}
return $resultRedirect->setPath('sales/order/index', [], ['error' => true]);
Expand Down

0 comments on commit bc5bde8

Please sign in to comment.