From 8194a1f247b7dca31e84704e37330c1b77dce7d3 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 16 Jan 2018 18:07:49 +0100 Subject: [PATCH] Added transaction information on paypal/paybox orders --- adm/tabs/AdminOrders.php | 1 + override/classes/Order.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index 2d95c6dc..95fe52d3 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -1324,6 +1324,7 @@ class AdminOrders extends AdminTab
'.$deviceHtml.'

'.Tools::substr($order->payment, 0, 32).' '.($order->module ? '('.$order->module.')' : '').'

+ '.Order::getPaymentInfos($order).'

'.$this->l('Cart #').sprintf('%06d', $cart->id).'

'.$this->l('Recycled package').'

'.(!empty($order->gift_message) ? ' '.$this->l('Gift wrapping').'':$this->l('Gift wrapping')).'

diff --git a/override/classes/Order.php b/override/classes/Order.php index 3d854b67..6777e7d2 100644 --- a/override/classes/Order.php +++ b/override/classes/Order.php @@ -307,5 +307,34 @@ class Order extends OrderCore return $id_order_state?$id_order_state:false; } + public static function getPaymentInfos($order) + { + $returned_string = ''; + if(!Validate::isLoadedObject($order)){ + return ''; + } + if(strtolower($order->payment) === 'paypal'){ + $infos = Db::getInstance()->getRow(' + SELECT `id_transaction`, `payment_status`, `total_paid` + FROM `'._DB_PREFIX_.'paypal_order` + WHERE `id_order`='.(int)$order->id + ); + $paypal_base_url = 'https://www.paypal.com/activity/payment/'; + $returned_string .= '

ID TRANS. : '. + $infos['id_transaction'].' ()'. + '

'; + }elseif(strtolower($order->payment) === 'paybox'){ + $infos = Db::getInstance()->getRow(' + SELECT `paiement`, `num_transaction` + FROM `'._DB_PREFIX_.'paybox_transaction` + where `id_cart` ='.(int)$order->id_cart + ); + $returned_string .= '

ID : '. + $infos['num_transaction'].' - '.$infos['paiement']. + '

'; + } + return $returned_string; + + } }