franzneves Posted August 24, 2014 Share Posted August 24, 2014 How do I insert the order ID on the invoice (PDF) Thanks Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 Where do you want it to appear? Please provide a screen shot showing the placement Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 (edited) I would like the header and if possible with H1 format. Thanks Edited August 24, 2014 by franzneves (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 Please provide a screen shot showing the placement Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 (edited) Edited August 24, 2014 by franzneves (see edit history) Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 Excuse me Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 I assume "Fatura" means "invoice"? So you want the Order ID to appear under "Fatura #000196"? Now, do you want the Order Id or the Order Reference to appear? Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 (edited) Order ID appear under "Fatura #000196 . Thanks Edited August 24, 2014 by franzneves (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 I assume you are using PS v1.6.0.9. Do the following 1) edit \pdf\header.tpl: You are adding this inside the table <tr> <td style="font-size: 14pt; color: #9E9F9E">{$orderref|escape:'html':'UTF-8'}</td> </tr> So it should look like this... <table style="width: 100%"> <tr> <td style="font-weight: bold; font-size: 14pt; color: #444; width: 100%">{$shop_name|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$date|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$title|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$orderref|escape:'html':'UTF-8'}</td> </tr> </table> 2) edit \classes\pdf\HTMLTemplateInvoice.php. You are adding this to the end of the __construct function $orderref = HTMLTemplateInvoice::l('Order ').' #'.sprintf('%06d', $this->order->id); $this->smarty->assign(array( 'orderref' => $orderref, )); So the entire function should look like this public function __construct(OrderInvoice $order_invoice, $smarty) { $this->order_invoice = $order_invoice; $this->order = new Order((int)$this->order_invoice->id_order); $this->smarty = $smarty; // header informations $this->date = Tools::displayDate($order_invoice->date_add); $id_lang = Context::getContext()->language->id; $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); // footer informations $this->shop = new Shop((int)$this->order->id_shop); $orderref = HTMLTemplateInvoice::l('Order ').' #'.sprintf('%06d', $this->order->id); $this->smarty->assign(array( 'orderref' => $orderref, )); } 5 Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 I inserted this code but did not work what am I doing wrong? _________________________________ public function __construct(OrderInvoice $order_invoice, $smarty) { $this->order_invoice = $order_invoice; $this->order = new Order((int)$this->order_invoice->id_order); $this->smarty = $smarty; // header informations $this->date = Tools::displayDate($order_invoice->date_add); $id_lang = Context::getContext()->language->id; $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); // footer informations $this->shop = new Shop((int)$this->order->id_shop); $orderref = HTMLTemplateInvoice::l('Order ').' #'.sprintf('%06d', $this->order->id); $this->smarty->assign(array( 'orderref' => $orderref, )); } ________________________________ <table style="width: 100%"> <tr> <td style="width: 50%"> {if $logo_path} <img src="{$logo_path}" style="width:{$width_logo}px; height:{$height_logo}px;" /> {/if} xxxxx </td> <td style="width: 50%; text-align: right;"> <table style="width: 100%"> <tr> <td style="font-weight: bold; font-size: 14pt; color: #444; width: 100%">{$shop_name|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$date|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$title|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$orderref|escape:'html':'UTF-8'}</td> </tr </table> </td> </tr> </table> Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 my magic 8 ball says you did it wrong. Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 I do not understand Link to comment Share on other sites More sharing options...
bellini13 Posted August 24, 2014 Share Posted August 24, 2014 Do you have your smarty cache set to never recompile? (advanced preferences > performance). If you followed my instructions then it would work. I can't read your mind, or see what you have done, so how can I tell you what you did wrong? 1 Link to comment Share on other sites More sharing options...
franzneves Posted August 24, 2014 Author Share Posted August 24, 2014 Ok. Thanks. I will try again. Link to comment Share on other sites More sharing options...
franzneves Posted August 25, 2014 Author Share Posted August 25, 2014 Works!!! Thanks!!!!! Link to comment Share on other sites More sharing options...
bellini13 Posted August 25, 2014 Share Posted August 25, 2014 what was the issue? Link to comment Share on other sites More sharing options...
franzneves Posted August 25, 2014 Author Share Posted August 25, 2014 I do not know redid everything. Thanks again. Link to comment Share on other sites More sharing options...
Nikhil Kumar Posted February 26, 2016 Share Posted February 26, 2016 I inserted this code but did not work what am I doing wrong? _________________________________ public function __construct(OrderInvoice $order_invoice, $smarty) { $this->order_invoice = $order_invoice; $this->order = new Order((int)$this->order_invoice->id_order); $this->smarty = $smarty; // header informations $this->date = Tools::displayDate($order_invoice->date_add); $id_lang = Context::getContext()->language->id; $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); // footer informations $this->shop = new Shop((int)$this->order->id_shop); $orderref = HTMLTemplateInvoice::l('Order ').' #'.sprintf('%06d', $this->order->id); $this->smarty->assign(array( 'orderref' => $orderref, )); } ________________________________ <table style="width: 100%"> <tr> <td style="width: 50%"> {if $logo_path} <img src="{$logo_path}" style="width:{$width_logo}px; height:{$height_logo}px;" /> {/if} xxxxx </td> <td style="width: 50%; text-align: right;"> <table style="width: 100%"> <tr> <td style="font-weight: bold; font-size: 14pt; color: #444; width: 100%">{$shop_name|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$date|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$title|escape:'html':'UTF-8'}</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$orderref|escape:'html':'UTF-8'}</td> </tr </table> </td> </tr> </table> HI please can u tell how to get order->refernce (also called as order->name or order->number) for the same Link to comment Share on other sites More sharing options...
tuk66 Posted February 28, 2016 Share Posted February 28, 2016 What version? Link to comment Share on other sites More sharing options...
PoojaVaithy Posted March 9, 2016 Share Posted March 9, 2016 (edited) I am developing a mobile application using prestashop. I use web service to access the data. But I have a problem if a register a new customer through mobile I am unable to access that account in website. Do anyone have idea for this problem? Thanks, Bala Edited March 9, 2016 by PoojaVaithy (see edit history) Link to comment Share on other sites More sharing options...
PoojaVaithy Posted March 9, 2016 Share Posted March 9, 2016 (edited) I am developing a mobile application using prestashop. I use web service to access the data. But I am unable to access the web service. The problem is when I give the key as login id the authentication is been asked repeatedly. Can anyone give me a suggestion to recover from this problem? Thanks, Bala Edited March 9, 2016 by PoojaVaithy (see edit history) Link to comment Share on other sites More sharing options...
mattheoh Posted April 25, 2016 Share Posted April 25, 2016 Hi This tip works perfectly on 1.6.1.5 Thanks a lot. Link to comment Share on other sites More sharing options...
Recommended Posts