From 2a1e2df946f6284c4a0c4b5866e75dd009ef4d73 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 6 Jun 2024 15:29:13 +0530 Subject: [PATCH] Updated: Set the order currency at first element of currencies in Add Payment form in Back-office order detail page --- controllers/admin/AdminOrdersController.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 08f42a0ac..970e130f1 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -630,11 +630,23 @@ class AdminOrdersControllerCore extends AdminController $payment_methods[] = $module->displayName; } } + + // Set the order currency at first element of currencies + if ($currencies = Currency::getCurrenciesByIdShop($objOrder->id_shop)) { + foreach ($currencies as $key => $currency) { + if ($currency['id_currency'] == $objOrder->id_currency) { + unset($currencies[$key]); + array_unshift($currencies, $currency); + break; + } + } + } + $this->context->smarty->assign( array( 'current_index' => self::$currentIndex, 'order' => $objOrder, - 'currencies' => Currency::getCurrenciesByIdShop($objOrder->id_shop), + 'currencies' => $currencies, 'payment_methods' => $payment_methods, 'payment_types' => $this->getPaymentsTypes(), 'invoices_collection' => $objOrder->getInvoicesCollection(),