democolis Posted July 10, 2015 Share Posted July 10, 2015 Hello, I am trying to insert the Order Message/Note into invoice.pdf in prestashop 1.6.0.14. i have make a function stored in override/classes/order/OrderInvoice.php I try to get the order message from my database with this class: public static function getMessages($id_order) { $messages = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT `message` FROM `'._DB_PREFIX_.'message` WHERE `id_order` = '.(int)$id_order.' ORDER BY `id_message` '); return nl2br(implode("\n", (array)$messages)); } How can i make it appears in my invoice.tpl? i try with {$order_detail.messages} but this does not work. Can somebody help me? Can someone describe me another way to appear the message in invoice.pdf? Thanks! Link to comment Share on other sites More sharing options...
dooban Posted February 1, 2017 Share Posted February 1, 2017 Did you manage to solve this ? I am also interested in inserting the message on the invoice. Thanks Link to comment Share on other sites More sharing options...
Pitak Posted February 5, 2017 Share Posted February 5, 2017 Hi, I just implemented this feature on PS 1.6.1.7 Just follow https://www.prestashop.com/forums/topic/145386-adding-customer-comment-message-to-delivery-invoice-pdf/?do=findComment&comment=1676592 with following modification due to PS 1.6.1: Step 4: use /pdf/invoice.product-tab.tpl instead of /pdf/invoice.tpl. In my case I just added the following at the end of the /pdf/invoice.product-tab.tpl to make it looks like a table: <!-- Customer Order Message --> <br/> {if isset($order_detail.first_order_message) && $order_detail.first_order_message} <table id="order_msg" class="product" width="100%"> <tr> <td class="center grey bold" width="20%">{l s='Oder Comment' pdf='true'}</td> <td class="left white" width="80%">{$order_detail.first_order_message}</td> </tr> </table> {/if} It is probably not the best solution, but it works fine for me If somebody has a better one, pls share! Regards, Sergey 1 Link to comment Share on other sites More sharing options...
celeg Posted August 24, 2018 Share Posted August 24, 2018 Work fine for me in ps 1.7.4.2 Thank you 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