Skip to content

Commit

Permalink
Merge pull request #11235 from mnastalski/backend-orders-performance
Browse files Browse the repository at this point in the history
Prevent unnecessary Order objects from being created in Admin Orders
  • Loading branch information
Quetzacoalt91 committed Nov 20, 2018
2 parents 22c5347 + 5898022 commit 37eb002
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controllers/admin/AdminOrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,14 @@ public function __construct()

public static function setOrderCurrency($echo, $tr)
{
$order = new Order($tr['id_order']);
if (!empty($tr['id_currency'])) {
$idCurrency = (int) $tr['id_currency'];
} else {
$order = new Order($tr['id_order']);
$idCurrency = (int) $order->id_currency;
}

return Tools::displayPrice($echo, (int) $order->id_currency);
return Tools::displayPrice($echo, $idCurrency);
}

public function initPageHeaderToolbar()
Expand Down

0 comments on commit 37eb002

Please sign in to comment.