From 89fb2e100abb4972c90cc6cf5e82d5a87cbac5d7 Mon Sep 17 00:00:00 2001 From: vSchoener Date: Tue, 25 Oct 2011 09:09:06 +0000 Subject: [PATCH] [-] CORE: Add details payment from payment_cc in the order view --- admin-dev/themes/template/orders/view.tpl | 12 ++++++++++-- classes/PaymentCC.php | 15 +++++++++++++++ controllers/admin/AdminOrdersController.php | 3 ++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/admin-dev/themes/template/orders/view.tpl b/admin-dev/themes/template/orders/view.tpl index c179ae157..d723802c1 100755 --- a/admin-dev/themes/template/orders/view.tpl +++ b/admin-dev/themes/template/orders/view.tpl @@ -211,7 +211,15 @@
{l s='Cart #'}{"%06d"|sprintf:$cart->id}
-
{substr($order->payment, 0, 32)}{if $order->module} ({$order->module}){/if}
+
{substr($order->payment, 0, 32)}{if $order->module} ({$order->module}){/if}
+ + {if $paymentCCDetails} +
+ +
{$paymentCCDetails['transaction_id']}
+
+ {/if} +
@@ -267,7 +275,7 @@ {/if} - +
 
diff --git a/classes/PaymentCC.php b/classes/PaymentCC.php index 1da973fa7..3722b8f52 100644 --- a/classes/PaymentCC.php +++ b/classes/PaymentCC.php @@ -70,5 +70,20 @@ class PaymentCCCore extends ObjectModel } return false; } + + /** + * Get the detailed payment of an order + * @param int $id_order + * @return array + */ + public static function getByOrderId($id_order) + { + $query = ' + SELECT * + FROM `'._DB_PREFIX_.'payment_cc` + WHERE `id_order` = '.$id_order; + + return Db::getInstance()->getRow($query); + } } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 27219a30f..663f04a73 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -513,7 +513,8 @@ class AdminOrdersControllerCore extends AdminController 'currentIndex' => self::$currentIndex, 'carrierModuleCall' => $carrier_module_call, 'iso_code_lang' => $this->context->language->iso_code, - 'id_lang' => $this->context->language->id + 'id_lang' => $this->context->language->id, + 'paymentCCDetails' => PaymentCC::getByOrderId($order->id) )); // Assign Hook