Back office order comments 1.6

In the latest versions of prestashop we have the problem that do not appear in the backoffice comments dorders information.
We will try to solve it by making a series of changes in some files in the installation of prestashop version

– Open CustomerThread.php file from classes folder and add following function just after function getNextThread.

public static function getCustomerMessagesByOrderId($id_order)
  $sql = 'SELECT ct.*,cm.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname
   FROM '._DB_PREFIX_.'customer_thread ct
   LEFT JOIN '._DB_PREFIX_.'customer_message cm
    ON ct.id_customer_thread = cm.id_customer_thread
   LEFT JOIN `'._DB_PREFIX_.'customer` c
    ON ct.`id_customer` = c.`id_customer`
   LEFT JOIN '._DB_PREFIX_.'employee e
    ON cm.id_employee = e.id_employee
   WHERE id_order = '.(int)$id_order.' ORDER BY cm.id_customer_message DESC';

  return Db::getInstance()->executeS($sql);


– Open AdminOrdersController.php file from controllers/admin folder and replace this line

'messages' => Message::getMessagesByOrderId($order->id, true),

with this

'messages' => CustomerThread::getCustomerMessagesByOrderId($order->id, true),

To show date and time in messages Both view.tpl from yourAdmin open file / themes / default / template / controllers / orders / helpers / view folder and change line 765

{l s='At'} <i>{dateFormat date=$message['date_add']}

with this

{l s='At'} <i>{$message['date_add']}







Posted on 05/04/2014 in Prestashop

Share the Story

About the Author

Response (1)

  1. Lonegan
    12/04/2014 at 4:55 am · Responder

    Thanks for the guide. works fine

Leave a reply

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Back to Top