Eutanasio Posted August 13, 2014 Share Posted August 13, 2014 (edited) Hello,In the admin panel the Customer Threads are by default sort by ID ascendent and I'd like it to be descendent so first threads to see are the newest. How can I do that?? I think should be in / PS / controllers / admin / AdminCustomerThreadsController.php, but can't find where. I use PS 1.6 Thanks Edited August 14, 2014 by omar2886 (see edit history) Link to comment Share on other sites More sharing options...
itobe33 Posted March 19, 2015 Share Posted March 19, 2015 hey there, i have the same problem, i want all custmoer threads to be ordered by date and the latest on top but i have no clue on how to realize that. cant find anything in that controller class pelase help, its so stupid to always have to walk across several pages until you reach the open threads Link to comment Share on other sites More sharing options...
Mickeel Posted April 8, 2015 Share Posted April 8, 2015 check line 243 $this->_group = 'GROUP BY cm.id_customer_thread'; $this->_orderBy = 'id_customer_thread'; $this->_orderWay = 'DESC'; change the 'id_customer_thread' to 'date_upd' as below $this->_group = 'GROUP BY cm.id_customer_thread'; $this->_orderBy = 'date_upd'; $this->_orderWay = 'DESC'; Link to comment Share on other sites More sharing options...
Eutanasio Posted April 11, 2015 Author Share Posted April 11, 2015 Thanks but this doesn't work for me, I can't find those lines, I use PS 1.6. thanks! check line 243 $this->_group = 'GROUP BY cm.id_customer_thread'; $this->_orderBy = 'id_customer_thread'; $this->_orderWay = 'DESC'; change the 'id_customer_thread' to 'date_upd' as below $this->_group = 'GROUP BY cm.id_customer_thread'; $this->_orderBy = 'date_upd'; $this->_orderWay = 'DESC'; Link to comment Share on other sites More sharing options...
Mickeel Posted April 12, 2015 Share Posted April 12, 2015 What version are you using to be exact. 1.6.0.11? try find the following text first. public function renderList() The parameter is inside it, it should be around line 215 in AdminCustomerThreadController.php Link to comment Share on other sites More sharing options...
Eutanasio Posted April 24, 2015 Author Share Posted April 24, 2015 Hi! thanks for following up with me. this is what I have on that section: public function renderList() { $this->addRowAction('view'); $this->addRowAction('delete'); $this->_select = ' CONCAT(c.`firstname`," ",c.`lastname`) as customer, cl.`name` as contact, l.`name` as language, group_concat(message) as messages, ( SELECT IFNULL(CONCAT(LEFT(e.`firstname`, 1),". ",e.`lastname`), "--") FROM `'._DB_PREFIX_.'customer_message` cm2 INNER JOIN '._DB_PREFIX_.'employee e ON e.`id_employee` = cm2.`id_employee` WHERE cm2.id_employee > 0 AND cm2.`id_customer_thread` = a.`id_customer_thread` ORDER BY cm2.`date_add` DESC LIMIT 1 ) as employee'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'customer` c ON c.`id_customer` = a.`id_customer` LEFT JOIN `'._DB_PREFIX_.'customer_message` cm ON cm.`id_customer_thread` = a.`id_customer_thread` LEFT JOIN `'._DB_PREFIX_.'lang` l ON l.`id_lang` = a.`id_lang` LEFT JOIN `'._DB_PREFIX_.'contact_lang` cl ON (cl.`id_contact` = a.`id_contact` AND cl.`id_lang` = '.(int)$this->context->language->id.')'; $this->_group = 'GROUP BY cm.id_customer_thread'; $contacts = CustomerThread::getContacts(); $categories = Contact::getCategoriesContacts(); $params = array( $this->l('Total threads') => $all = CustomerThread::getTotalCustomerThreads(), $this->l('Threads pending') => $pending = CustomerThread::getTotalCustomerThreads('status LIKE "%pending%"'), $this->l('Total number of customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'), $this->l('Total number of employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'), $this->l('Unread threads') => $unread = CustomerThread::getTotalCustomerThreads('status = "open"'), $this->l('Closed threads') => $all - ($unread + $pending) ); $this->tpl_list_vars = array( 'contacts' => $contacts, 'categories' => $categories, 'params' => $params ); return parent::renderList(); } 1 Link to comment Share on other sites More sharing options...
Recommended Posts