il15 Posted October 28, 2012 Share Posted October 28, 2012 Hello, I just update from 1.4.9 to 1.5.2 and I found one problem. Once I leave a message to a customer in the order detail page, it is not showing in the order product like before, I have to go to the customer service tab. Is there anyway to make the messages appear at the order page like before? Thank you. Link to comment Share on other sites More sharing options...
Pressed0024 Posted November 16, 2012 Share Posted November 16, 2012 Prestashop, you are not listening to us shop owners. So what if you centralized messages in Customer Service tab? How are we going to provide awesome customer service when it's so hard to view messages left for that order? We need to be able to leave notes for a specific order like in the past and NOT threat every comment as a ticket. You are a developer, not a store owner, you can't understand the pain we are having when you centralize all the messages without being able to leave order specific comment and view them in the BO order page. I suggest you provide a patch we could use so that at least comments regarding the order is shown in BO order page. People all find it hard to handle the orders because we can't leave notes to the order and view it quickly: PSCFV-1323 PSCFV-5053 PSCFV-4831 http://www.prestashop.com/forums/topic/197912-messages-to-customers-not-showing-in-order-detail-page/ PSCFV-5486 2 Link to comment Share on other sites More sharing options...
Pressed0024 Posted November 16, 2012 Share Posted November 16, 2012 What happened to the prestashop forum team? I noticed they have stopped replying to forum post. They seems to have taken a LONG holiday or something. Would anymore post a patch fix to display the posted order comments? 2 Link to comment Share on other sites More sharing options...
Pressed0024 Posted November 16, 2012 Share Posted November 16, 2012 Okay. This is REALLY stupid. I just made mistakes on 20+ orders and double sent emails to customer because I couldn't see the order comment history..... 1 Link to comment Share on other sites More sharing options...
jimmyc Posted February 20, 2013 Share Posted February 20, 2013 Same here This is crazy and extremely difficult to navigate and really bad. the new system is fine but we need to see the list of massages in the order again also. 1 Link to comment Share on other sites More sharing options...
Pressed0024 Posted February 20, 2013 Share Posted February 20, 2013 They just don't get it. It's already been reported in forge.prestashop.com but they decided not to move forward. Link to comment Share on other sites More sharing options...
jimmyc Posted February 20, 2013 Share Posted February 20, 2013 Yeah we use it to enter tracking info because we cannot use the default tracking system with our shipping. Now we cannot see if we sent the tracking info and spend hours dealing with customers that did not get tracking info or got double emails etc etc etc. Link to comment Share on other sites More sharing options...
webbusiness23 Posted March 4, 2013 Share Posted March 4, 2013 Did anyone solve this? I have the same problem on 1.5.3.1 Link to comment Share on other sites More sharing options...
Pressed0024 Posted March 4, 2013 Share Posted March 4, 2013 Prestashop has feedback in forge that they don't plan to tackle this issue at the moment. We will have to continue using the Customer Service message system until they decided on something else. Create a forge issue if you wana help push them to relook into this issue. I think the current message system is pretty crap. I wish they brought back the ability to leave and email messages via the order page and maybe improve it. 2 Link to comment Share on other sites More sharing options...
CVpeet Posted March 14, 2013 Share Posted March 14, 2013 (edited) Prestashop has feedback in forge that they don't plan to tackle this issue at the moment. We will have to continue using the Customer Service message system until they decided on something else. Create a forge issue if you wana help push them to relook into this issue. I think the current message system is pretty crap. I wish they brought back the ability to leave and email messages via the order page and maybe improve it. Replace the original code by this code on line 91 until 114 (getMessagesByOrderId string) in Message.php class (in classes map). CREDITS GO TO hoplajetzt public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { if (!Validate::isBool($private)) die(Tools::displayError()); if (!$context) $context = Context::getContext(); $m = Db::getInstance()->executeS(' SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me FROM `'._DB_PREFIX_.'message` m LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON mr.`id_message` = m.`id_message` AND mr.`id_employee` = '.(isset($context->employee) ? (int)$context->employee->id : '\'\'').' LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE m.`id_order` = '.(int)$id_order.' '.(!$private ? ' AND m.`private` = 0' : '').' GROUP BY m.id_message ORDER BY m.date_add DESC '); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); return array_merge($o,$m); } Works perfect! Edited March 14, 2013 by CVpeet (see edit history) 9 Link to comment Share on other sites More sharing options...
jimmyc Posted March 15, 2013 Share Posted March 15, 2013 Brilliant I will test this a little but so far so good. Thanks a million. This needs to be standard on prestashop again. Link to comment Share on other sites More sharing options...
Pressed0024 Posted March 15, 2013 Share Posted March 15, 2013 Will this affect the database structure during future prestashop updates? Link to comment Share on other sites More sharing options...
nortom Posted March 26, 2013 Share Posted March 26, 2013 I had the same problem in 1.5.4 also 1.5.3 so what's be the problem? The fix works but it must be a problem in the db?? Link to comment Share on other sites More sharing options...
lordshop Posted April 3, 2013 Share Posted April 3, 2013 (edited) Replace the original code by this code on line 91 until 114 (getMessagesByOrderId string) in Message.php class (in classes map). CREDITS GO TO hoplajetzt public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { if (!Validate::isBool($private)) die(Tools::displayError()); if (!$context) $context = Context::getContext(); $m = Db::getInstance()->executeS(' SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me FROM `'._DB_PREFIX_.'message` m LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON mr.`id_message` = m.`id_message` AND mr.`id_employee` = '.(isset($context->employee) ? (int)$context->employee->id : '\'\'').' LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE m.`id_order` = '.(int)$id_order.' '.(!$private ? ' AND m.`private` = 0' : '').' GROUP BY m.id_message ORDER BY m.date_add DESC '); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); return array_merge($o,$m); } Works perfect! I have 1.5.4 and works perfect. Excellent guys! Edited April 3, 2013 by lordshop (see edit history) 2 Link to comment Share on other sites More sharing options...
devilsown Posted April 17, 2013 Share Posted April 17, 2013 Thanks for putting this out there. This is one of the items that was fustrating me so much with 1.5.4 why would anyone want to do it the new way. I want to see all the information for the order when i am in the order. Link to comment Share on other sites More sharing options...
shopimport.nl Posted April 21, 2013 Share Posted April 21, 2013 Nice it's working for 1.5.3! I little bit improved it to be less depending on future versions. Instead of replacing the original classes/Messages.php this function makes use of the override. Just add this function in the override/classes/Messages.php so just below: class Message extends MessageCore { public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { $m=parent::getMessagesByOrderId($id_order, $private, $context); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); return array_merge($o,$m); } } Thanks to the original person who posted this fix! 3 Link to comment Share on other sites More sharing options...
peter_m Posted May 11, 2013 Share Posted May 11, 2013 (edited) view comments in reverse order? Latest comments at the top of the page ? Edited May 11, 2013 by peter_m (see edit history) Link to comment Share on other sites More sharing options...
shykoo Posted May 14, 2013 Share Posted May 14, 2013 Thanks a million to Shopimport.nl ! u're the man! your override code works great on 1.5.3, Link to comment Share on other sites More sharing options...
shykoo Posted May 14, 2013 Share Posted May 14, 2013 (edited) I have another issue - my message to customer is using the english tamplate: order_merchant:comment.html even though my BO language and all my core mails are Danish Any idea? Thanks Edited May 14, 2013 by shykoo (see edit history) Link to comment Share on other sites More sharing options...
mytheory. Posted May 23, 2013 Share Posted May 23, 2013 (edited) Hi, WOW! Thanks! Saved us a lot of time and headaches. S/O to hoplajetzt and CVpeet and shopimport.nl (for the clean override). Confirming that the override works in PS v.1.5.4.1... the Message.php class isn't there in the override folder anymore, but you can just create it or transfer one from PS v.1.5.3 and modify that one. Thanks again! Edited May 23, 2013 by mytheory. (see edit history) Link to comment Share on other sites More sharing options...
lordshop Posted July 12, 2013 Share Posted July 12, 2013 Hi, WOW! Thanks! Saved us a lot of time and headaches. S/O to hoplajetzt and CVpeet and shopimport.nl (for the clean override). Confirming that the override works in PS v.1.5.4.1... the Message.php class isn't there in the override folder anymore, but you can just create it or transfer one from PS v.1.5.3 and modify that one. Thanks again! override sounds nice but it doesn't work for me. So and again, I replace the code in 1.5.4.1 Link to comment Share on other sites More sharing options...
roland_d_alsace Posted July 17, 2013 Share Posted July 17, 2013 override sounds nice but it doesn't work for me. The override file name is Message.php (and not Messages.php) delete your /cache/class_index.php for PS regenerate the cache class file. 2 Link to comment Share on other sites More sharing options...
besssbesss Posted July 29, 2013 Share Posted July 29, 2013 Hi, thank you for this tip !!! Just, I want to know, if it is possible to mark the message as closed in the aftersales page in backoffice. When I answer an order message, in the page with all the messages, there is the green round near the message. How could I do that please ? thank you Link to comment Share on other sites More sharing options...
besssbesss Posted September 5, 2013 Share Posted September 5, 2013 Hello. The message send by the clients are ok with specials characters. But, the messages we send to clients are not displayed correctly. Just in the order page. Not on the SAV system. Somebody could help me with that please? Link to comment Share on other sites More sharing options...
Pressed0024 Posted September 5, 2013 Share Posted September 5, 2013 Have you tried reporting to forge.prestashop.com? Link to comment Share on other sites More sharing options...
devilsown Posted September 5, 2013 Share Posted September 5, 2013 "its not a bug" they have no desire to "fix" this as this is how its intended to work from now on. It way to hard to use and the old way works so much better. Link to comment Share on other sites More sharing options...
shroom Posted October 2, 2013 Share Posted October 2, 2013 Bumping this thread to confirm that this override somehow works but doesn't handle special characters. Link to comment Share on other sites More sharing options...
besssbesss Posted January 28, 2014 Share Posted January 28, 2014 Hello. How could we do to fix the special characters for the messages on the order page in the back office please ? I try to find a solution by I failed. Someone could help me ? Thank you Link to comment Share on other sites More sharing options...
ghomi Posted March 13, 2014 Share Posted March 13, 2014 It's works on 1.5.6.1 and 1.5.4.1! Thanks a lot! Link to comment Share on other sites More sharing options...
malcek Posted March 21, 2014 Share Posted March 21, 2014 Hi To person who posted this solution. Many, Many, Many thanks for this as someone describe above, that guys on prestashop are good proggrammers, but bad customer support, we were lost now for trhee month since we upgrade to version 1.5, till today when all massages are back where they should be Martin Link to comment Share on other sites More sharing options...
anpori Posted March 26, 2014 Share Posted March 26, 2014 hoplajetzt,THANKS A MILLION!!!! Works great on version 1.5.6.2 Link to comment Share on other sites More sharing options...
jimmyc Posted April 27, 2014 Share Posted April 27, 2014 Any solutions for 1.6 anyone? Now we post messages ans they completely disappear form any records we can find anywhere. Link to comment Share on other sites More sharing options...
vekia Posted April 27, 2014 Share Posted April 27, 2014 hello this solution based on 1.5.6.2 should work in 1.6 have you tried it? 1 Link to comment Share on other sites More sharing options...
jimmyc Posted April 27, 2014 Share Posted April 27, 2014 Not yet But i will. Thanks Vekia. Link to comment Share on other sites More sharing options...
jimmyc Posted April 27, 2014 Share Posted April 27, 2014 Replace the original code by this code on line 91 until 114 (getMessagesByOrderId string) in Message.php class (in classes map). CREDITS GO TO hoplajetzt public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { if (!Validate::isBool($private)) die(Tools::displayError()); if (!$context) $context = Context::getContext(); $m = Db::getInstance()->executeS(' SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me FROM `'._DB_PREFIX_.'message` m LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON mr.`id_message` = m.`id_message` AND mr.`id_employee` = '.(isset($context->employee) ? (int)$context->employee->id : '\'\'').' LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE m.`id_order` = '.(int)$id_order.' '.(!$private ? ' AND m.`private` = 0' : '').' GROUP BY m.id_message ORDER BY m.date_add DESC '); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); return array_merge($o,$m); } Works perfect! Just to confirm this is working in 1.6.0.6... 1 Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted June 17, 2014 Share Posted June 17, 2014 Nice it's working for 1.5.3! I little bit improved it to be less depending on future versions. Instead of replacing the original classes/Messages.php this function makes use of the override. Just add this function in the override/classes/Messages.php so just below: class Message extends MessageCore { public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { $m=parent::getMessagesByOrderId($id_order, $private, $context); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); return array_merge($o,$m); } } Thanks to the original person who posted this fix! The override file name is Message.php (and not Messages.php) delete your /cache/class_index.php for PS regenerate the cache class file. I did the override, it works, but also shows this error above each message: Notice: Undefined index: is_new_for_me in/(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.phpon line 1270 > Notice: Undefined index: is_new_for_me in/(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.phpon line 1271 I'm using 1.5.6.2. Any solution? Thanks Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted June 21, 2014 Share Posted June 21, 2014 I also have the following error when the it's a message from the client: Notice: Undefined index: cfirstname in /(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.php on line 1284Notice: Undefined index: clastname in /(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.php on line 1285 Link to comment Share on other sites More sharing options...
ilovekutchi.com Posted June 21, 2014 Share Posted June 21, 2014 I did the override, it works, but also shows this error above each message: Notice: Undefined index: is_new_for_me in/(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.phpon line 1270 > Notice: Undefined index: is_new_for_me in/(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.phpon line 1271 I'm using 1.5.6.2. Any solution? Thanks I also have the following error when the it's a message from the client: Notice: Undefined index: cfirstname in /(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.php on line 1284 Notice: Undefined index: clastname in /(...)/cache/smarty/compile/4e/52/39/4e5239bf8b1be835172b156956001e177a76e7c4.file.view.tpl.php on line 1285 I circumvented these errors by changing the admin/themes/default/template/controllers/orders/helpers/view/view.tlp file: <div style="overflow:auto; width:400px;" {if isset($message['is_new_for_me'])}class="new_message"{/if}> {if (isset($message['is_new_for_me']))} <a class="new_message" title="{l s='Mark this message as \'viewed\''}" href="{$smarty.server.REQUEST_URI}&token={$smarty.get.token}&messageReaded={$message['id_message']}"><img src="../img/admin/enabled.gif" alt="" /></a> {/if} {l s='At'} <i>{dateFormat date=$message['date_add']} </i> {l s='from'} <b>{if ($message['elastname']|escape:'htmlall':'UTF-8')}{$message['efirstname']|escape:'htmlall':'UTF-8'} {$message['elastname']|escape:'htmlall':'UTF-8'}{else}{if (isset($message['cfirstname']))}{$message['cfirstname']|escape:'htmlall':'UTF-8'} {$message['clastname']|escape:'htmlall':'UTF-8'}{else}{l s='client'}{/if}{/if}</b> But I would prefer a better patch... Link to comment Share on other sites More sharing options...
shroom Posted July 9, 2014 Share Posted July 9, 2014 Any clue on how to make special characters display correctly? Link to comment Share on other sites More sharing options...
besssbesss Posted September 4, 2014 Share Posted September 4, 2014 Somebody know how can we add the hours when the message was posted please ? near the date. And, for me, it works well on 1.6.0.8. The special characters are OK. Just, the name of the customer do not appear. Someone knows why ? thank you Link to comment Share on other sites More sharing options...
jacajaca Posted November 20, 2014 Share Posted November 20, 2014 Customer messages do not work in order prestashop 1.4.2.5 help me? Link to comment Share on other sites More sharing options...
lordshop Posted November 25, 2014 Share Posted November 25, 2014 I have applied the code to 1.6.8 and still works perfect. All the customer messages showed in order page. Thanks again Link to comment Share on other sites More sharing options...
Hessellund Posted February 4, 2015 Share Posted February 4, 2015 I found this, slightly modified version of the override class Message.php to work great with Prestashop 1.6.0.9: Also attached the file - Message.php, put it into /override/classes/Message.php class Message extends MessageCore { public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { $m=parent::getMessagesByOrderId($id_order, $private, $context); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' AND e.`id_employee` <> 0 ORDER BY ct.`date_add` DESC' ); return array_merge($m,$o); } } 2 Link to comment Share on other sites More sharing options...
helikoptermannen Posted March 19, 2015 Share Posted March 19, 2015 I put Message.php above into /override/classes/ but I can still not se my replies. Do I need something more that this file? I run 1.6.0.9 Link to comment Share on other sites More sharing options...
DaBouncer Posted March 23, 2015 Share Posted March 23, 2015 I created and added /override/classes/Message.php according to above code, but did not work for me without a <?php at the very top of the file. Excellent override, thanks! Link to comment Share on other sites More sharing options...
helikoptermannen Posted March 23, 2015 Share Posted March 23, 2015 I have that php text but it still not working. Will it only work on future replies or should the older ones also show up? Link to comment Share on other sites More sharing options...
DaBouncer Posted March 23, 2015 Share Posted March 23, 2015 I'm on v1.5.6.2 Did you delete /public_html/YOURSERVER/cache/class_index.php ? Link to comment Share on other sites More sharing options...
helikoptermannen Posted March 24, 2015 Share Posted March 24, 2015 My bad... it is working! Link to comment Share on other sites More sharing options...
Calatravo Posted July 3, 2015 Share Posted July 3, 2015 (edited) Hi, I have been testing this on 1.609 and i think this is the best solution. <?php class Message extends MessageCore { public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { if (!Validate::isBool($private)) die(Tools::displayError()); if (!$context) $context = Context::getContext(); /*$m = Db::getInstance()->executeS(' SELECT m.*, c.`firstname` AS cfirstname, c.`lastname` AS clastname, e.`firstname` AS efirstname, e.`lastname` AS elastname, (COUNT(mr.id_message) = 0 AND m.id_customer != 0) AS is_new_for_me FROM `'._DB_PREFIX_.'message` m LEFT JOIN `'._DB_PREFIX_.'customer` c ON m.`id_customer` = c.`id_customer` LEFT JOIN `'._DB_PREFIX_.'message_readed` mr ON mr.`id_message` = m.`id_message` AND mr.`id_employee` = '.(isset($context->employee) ? (int)$context->employee->id : '\'\'').' LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE m.`id_order` = '.(int)$id_order.' '.(!$private ? ' AND m.`private` = 0' : '').' GROUP BY m.id_message ORDER BY m.date_add DESC ');*/ $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' ORDER BY ct.`date_add` DESC' ); //return array_merge($o,$m); return $o; } } ?> I think the $m query is not neccessary, it just duplicates the first client messaje and loads the database. Just with the second query you get all messages. This is better solution than the recommended for 1.609 version just a few posts above becouse that solution just shows the shop messages not the customers replies. Hope it helps, you can delete the commented code between /* */ and the // Save it as Message.php and put it on /override/classes/Message.php then rename /cache/class_index.php to /cache/class_index_bak.php Edited July 3, 2015 by Calatravo (see edit history) 2 Link to comment Share on other sites More sharing options...
Photon Posted December 8, 2015 Share Posted December 8, 2015 Great job Thanks a lot for this mod, it works perfectly on PS 1.6.0.14 Link to comment Share on other sites More sharing options...
lordshop Posted January 23, 2017 Share Posted January 23, 2017 I found this, slightly modified version of the override class Message.php to work great with Prestashop 1.6.0.9: Also attached the file - Message.php, put it into /override/classes/Message.php class Message extends MessageCore { public static function getMessagesByOrderId($id_order, $private = false, Context $context = null) { $m=parent::getMessagesByOrderId($id_order, $private, $context); $o = Db::getInstance()->executeS(' SELECT ct.*, m.*, e.`firstname` AS efirstname, e.`lastname` AS elastname FROM `'._DB_PREFIX_.'customer_thread` ct LEFT JOIN `'._DB_PREFIX_.'customer_message` m ON m.`id_customer_thread` = ct.`id_customer_thread` LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = m.`id_employee` WHERE ct.`id_order` = '.(int)$id_order.' AND e.`id_employee` <> 0 ORDER BY ct.`date_add` DESC' ); return array_merge($m,$o); } } excellent. I confirm that is working on a 1.6.1.11 version just clear cache on site and browser 1 Link to comment Share on other sites More sharing options...
[email protected] Posted April 2, 2018 Share Posted April 2, 2018 still working perfect on 1.6.1.18!! Thank you mate! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now