[*] BO : Allows to get more details on the notification (customer name, total paid real, etc...)
This commit is contained in:
@@ -79,11 +79,16 @@ class Notification
|
|||||||
$json = array();
|
$json = array();
|
||||||
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql) as $key => $value)
|
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($sql) as $key => $value)
|
||||||
{
|
{
|
||||||
|
if (isset($value['id_order']))
|
||||||
|
{
|
||||||
|
$order = new Order(intval($value['id_order']));
|
||||||
|
$currency = new Currency(intval($order->id_currency));
|
||||||
|
}
|
||||||
$customer = new Customer(intval($value['id_customer']));
|
$customer = new Customer(intval($value['id_customer']));
|
||||||
$json[] = array(
|
$json[] = array(
|
||||||
'id_order' => ((isset($value['id_order'])) ? (int)$value['id_order'] : 0),
|
'id_order' => ((isset($value['id_order'])) ? (int)$value['id_order'] : 0),
|
||||||
'id_customer' => ((isset($value['id_customer'])) ? (int)$value['id_customer'] : 0),
|
'id_customer' => ((isset($value['id_customer'])) ? (int)$value['id_customer'] : 0),
|
||||||
'total_paid_real' => ((isset($value['total_paid_real'])) ? Tools::displayPrice(intval($value['total_paid_real'])) : 0),
|
'total_paid_real' => ((isset($value['total_paid_real'])) ? Tools::displayPrice((float)$value['total_paid_real'], $currency, false) : 0),
|
||||||
'customer_name' => $customer->firstname.' '.$customer->lastname,
|
'customer_name' => $customer->firstname.' '.$customer->lastname,
|
||||||
'message_customer' => ((isset($value['message'])) ? substr(strip_tags($value['message']), 0, 20) : '')
|
'message_customer' => ((isset($value['message'])) ? substr(strip_tags($value['message']), 0, 20) : '')
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user