Ray UK Posted September 7, 2013 Share Posted September 7, 2013 Hi, I have tried all I can to get these Order messages to work. I have followed instructions on here, but cannot get messages to display on the invoice. Now a customer has just placed an order with instructions. On the invoice it states that they have, and shows the customers name and date/time of message.. but the message is blank :/ See pic attached Any help with this is appreciated. Ray Link to comment Share on other sites More sharing options...
eleazar Posted September 8, 2013 Share Posted September 8, 2013 (edited) Have a look here: http://www.prestashop.com/forums/topic/266215-gelost-nachricht-in-der-bestellung/?do=findComment&comment=1329117 Or did you mean the back office order? In this case you find an override here: http://www.prestashop.com/forums/topic/266215-gelost-nachricht-in-der-bestellung/?view=findpost&p=1330005 Edited September 8, 2013 by eleazar (see edit history) Link to comment Share on other sites More sharing options...
howardliptzin Posted September 13, 2013 Share Posted September 13, 2013 I would like to add the total weight and number of boxes to the invoice template. The latter is calculated by the UPS module and is of secondary importance. The total weight, however, is part of the PS database. What code should I use to insert it into the invoice template? Thanks! Link to comment Share on other sites More sharing options...
eleazar Posted September 14, 2013 Share Posted September 14, 2013 (edited) Which means you need two components, the total weight itself and the weight unit, right? total weight should be {$cart->getTotalWeight()} and weight unit: Configuration::get('PS_WEIGHT_UNIT') So you should use something like that: {$cart->getTotalWeight().' '.Configuration::get('PS_WEIGHT_UNIT')} Edited September 15, 2013 by eleazar (see edit history) 1 Link to comment Share on other sites More sharing options...
howardliptzin Posted September 17, 2013 Share Posted September 17, 2013 Thanks eleazar. I pasted your code in the following table. But when I try to generate a PDF, I get a server error in the browser. WHen I remove the code, the PDF is generated normally: <table style="width: 100%"> <tr> <td style="width: 15%; padding-right: 7px; text-align: right; vertical-align: top; font-size: 7pt;"> <!-- CUSTOMER INFORMATION --> <b>{l s='Order Number:' pdf='true'}</b><br /> {$order->getUniqReference()}<br /> <br /> <b>{l s='Order Date:' pdf='true'}</b><br /> {dateFormat date=$order->date_add full=0}<br /> <br /> <b>{l s='Total Weight / #boxes:' pdf='true'}</b><br /><br /> {$cart->getTotalWeight().' '.Configuration::get('PS_WEIGHT_UNIT')}<br /> <br /> <b>{l s='Payment Method:' pdf='true'}</b><br /> <table style="width: 100%;"> {foreach from=$order_invoice->getOrderPaymentCollection() item=payment} <tr> <td style="width: 50%">{$payment->payment_method}</td> <td style="width: 50%">{displayPrice price=$payment->amount currency=$order->id_currency}</td> </tr> {foreachelse} <tr> <td>{l s='No payment' pdf='true'}</td> </tr> {/foreach} </table> What am I doing wrong? Link to comment Share on other sites More sharing options...
tuk66 Posted September 17, 2013 Share Posted September 17, 2013 What error? It looks like a syntax error. Maybe <table> tag is enclosed. Put </td></tr></table> at the end. Link to comment Share on other sites More sharing options...
howardliptzin Posted September 17, 2013 Share Posted September 17, 2013 (edited) the browser just reports a Error code: 500. when I remove that code and replace it with a series of characters such as: _ _ _ _ _ _ /_ _ the PDF generates correctly, showing the characters in the right place, using the same exact syntax. Edited September 17, 2013 by howardliptzin (see edit history) Link to comment Share on other sites More sharing options...
eleazar Posted September 17, 2013 Share Posted September 17, 2013 Problem is this part: {$cart->getTotalWeight()} It cannot work in invoice.tpl, I'm sorry. Whereas the weight unit will be displayed, if you just use: {Configuration::get('PS_WEIGHT_UNIT')} Link to comment Share on other sites More sharing options...
eleazar Posted September 17, 2013 Share Posted September 17, 2013 Ok, had a blind spot! The above works for the cart but not for the order! Use this in your invoice: {$order->getTotalWeight()} {Configuration::get('PS_WEIGHT_UNIT')} Works like a charm. 1 Link to comment Share on other sites More sharing options...
howardliptzin Posted September 17, 2013 Share Posted September 17, 2013 Brilliant! YES Link to comment Share on other sites More sharing options...
fox@dog Posted September 24, 2013 Share Posted September 24, 2013 Hello I like your PDF-Invoice. But i have some errors (see the image pdf.jpg). for every text we have a ? sign. How can we remove it? We have our shop in german. Link to comment Share on other sites More sharing options...
AlexFMS Posted September 25, 2013 Share Posted September 25, 2013 Hello, Since the 1.5.5 i don't understand where is the invoice.tpl ? Can you help me please ? Thanks a lot ! Link to comment Share on other sites More sharing options...
tuk66 Posted September 26, 2013 Share Posted September 26, 2013 In the /pdf subdirectory. Link to comment Share on other sites More sharing options...
augis2003 Posted September 26, 2013 Share Posted September 26, 2013 Hi, maybe someone know how i can write in invoice customer fistname, lastname, postcode, city in diferent places? I mean, now it is only delivery address as one part, but i need to make additional table in which all this info must be in diferent rows? i tryed in invoice.tpl like this: {$delivery_address->city} (to get city only) but it not working... Link to comment Share on other sites More sharing options...
tuk66 Posted September 26, 2013 Share Posted September 26, 2013 Look at getContent() function in HTMLTemplateInvoice.php. $delivery_address is already formatted address, just a string, not an object. 1 Link to comment Share on other sites More sharing options...
Smijn1 Posted September 29, 2013 Share Posted September 29, 2013 does anyone have an idea on how to add the customers VAT id on the invoice? thanks Link to comment Share on other sites More sharing options...
augis2003 Posted September 30, 2013 Share Posted September 30, 2013 (edited) does anyone have an idea on how to add the customers VAT id on the invoice? thanks in HTMLtemplateinvoice.php getcontent() function add: $vatnumber=$delivery_address-> vat_number; in smarty assign add: $this->smarty->assign(array( : 'vatnumber' => $vatnumber When in invoice.tpl where you want vat number to appear add: {$vatnumber} OR just in your backend on Countries, near Address format: write: vat_number And vat number will appear near customer address.. Edited September 30, 2013 by augis2003 (see edit history) Link to comment Share on other sites More sharing options...
augis2003 Posted September 30, 2013 Share Posted September 30, 2013 Look at getContent() function in HTMLTemplateInvoice.php. $delivery_address is already formatted address, just a string, not an object. Thanks. Your reply helped me figure out this. Link to comment Share on other sites More sharing options...
eleazar Posted October 4, 2013 Share Posted October 4, 2013 Hello I like your PDF-Invoice. But i have some errors (see the image pdf.jpg). for every text we have a ? sign. How can we remove it? We have our shop in german. Please post your invoice.tpl so that I can fix it. Or feel free to send it by PM. Link to comment Share on other sites More sharing options...
PEJ33 Posted October 9, 2013 Share Posted October 9, 2013 I am using version 1.4.9. Can anyone tell where the invoice.tpl file is located. Is it even called invoice.tpl in this version? If it has a different name can you tell me what it is and where to find it? Link to comment Share on other sites More sharing options...
tuk66 Posted October 9, 2013 Share Posted October 9, 2013 There is no invoice.tpl file in v1.4.9. Look at /classes/PDF.php where invoices are created. Link to comment Share on other sites More sharing options...
SPKF Posted October 14, 2013 Share Posted October 14, 2013 hello, I try to show some feature of my products, how do you know? Best regards, Link to comment Share on other sites More sharing options...
Davallen Posted October 15, 2013 Share Posted October 15, 2013 Thank you very much! Works well on 1.5.3.1 even though I just downloaded the files and implemented them Link to comment Share on other sites More sharing options...
benyv6 Posted October 22, 2013 Share Posted October 22, 2013 (edited) Hi, anybody knows how to display other dates than the date of order? I need to display the date when invoice was generated or at least date when payment was accepted. List of all variables avalible in $order will be handy. Thanks, EDIT: Found it. {$order->invoice_date|date_format:"%d-%m-%Y %H:%M"} All avalible variables are in classes/order/Order.php Edited October 22, 2013 by benyv6 (see edit history) Link to comment Share on other sites More sharing options...
Willem Jan Posted October 27, 2013 Share Posted October 27, 2013 Thanks for this guide I am really happy with this invoice and works perfect. Now i am trying to get the same layout on the delivery slip for returning items but with no succes. Does someone using this layout also for the delivery slip (return invoice) and can help me to get it right? Link to comment Share on other sites More sharing options...
MassiveRC Posted October 27, 2013 Share Posted October 27, 2013 (edited) I like to fold my invoices as they're printed and would like the customer order comments to show up below the invoice number (or besides the billing\shipping address) instead of at the bottom of the invoice. How can I move it? Thanks. Using PS default them for 1.5.2 Nevermind, I figured it out. BTW guys, if you open your invoice with Word you can test your changes before you upload them back to your PS install. Here's my modified invoice.tpl with the Order Notes moved to below the address. I also lightened the background border and changed the text color to black in order to save on ink. invoice.txt Edited October 27, 2013 by MassiveRC (see edit history) Link to comment Share on other sites More sharing options...
ericosman Posted October 30, 2013 Share Posted October 30, 2013 How do i "remove" the header because now the header.tpl is empty but still takes his place : Link to comment Share on other sites More sharing options...
ahmed1136 Posted October 31, 2013 Share Posted October 31, 2013 i would like to know as well how to remove the (empty) header.tpl margin [sOLVED] Found the solution myself. Goto /classes/pdf/PDFgenerator.php Around line 155 you will see $this->setMargins(10, 40, 10);Change it to $this->setMargins(10, 10, 10); Save my Day buddy thanks Link to comment Share on other sites More sharing options...
Mutabor Posted November 4, 2013 Share Posted November 4, 2013 How do i "remove" the header because now the header.tpl is empty but still takes his place : Look on page 4 of this topic; http://www.prestashop.com/forums/topic/213664-guide-modifying-prestashop-15-invoice-template/?view=findpost&p=1239375 This change did it for me. Link to comment Share on other sites More sharing options...
ZaLuno Posted November 9, 2013 Share Posted November 9, 2013 Hi! I have searched for a couple of days now for a specific solution for my Invoice problem, but no luck. In my invoice, billing and delivery address shows like this: John Doe Company Ltd. (optional) 34567890 (if company is filled also Vat number) Address Street 15 5000 Citiy Slovenia 30554466 (phone number) Is it possible, to add some labels to numbers? like this: John Doe Company Ltd. Vat no.: 34567890 Address Street 15 5000 City Slovenia Phone: 30554466 I was browsing through the invoice.tpl code and apparently invoice address is called from elsewhere. I see two solutions: 1. Find that elsewhere and add labels {l s='Vat no.' pdf='true'} and {l s='Phone' pdf='true'}. 2. Break apart (or replace) the {$invoice_address} into {$firstname} {$lastname} <br /> {$company} <br /> {l s='Vat no.' pdf='true'} :{$vat_number} <br /> {$address1} <br /> {address2} <br /> {$postcode} {$city} <br /> {$countryName} <br /> {l s='Phone' pdf='true'}: {$phone_number} Can someone point me in the right direction? I really need this fixed because of the laws and accounting issuies such unmarked numbers bring. 1 Link to comment Share on other sites More sharing options...
Housy Posted November 13, 2013 Share Posted November 13, 2013 Hi First of all thanks for your time, you are great!I do have a little problem. I'm from Slovenia and in my store I'm using Slovenian language, which has characters like "č, š, ž, đ, ..." but i get question marks, when this characters are used. How could i set UTF-8 encoding? That might solve this problem, i guess ... Regards, Housy Link to comment Share on other sites More sharing options...
ZaLuno Posted November 13, 2013 Share Posted November 13, 2013 Housy, On our site we solved the problem by using different font. I reccomend Trebuchet MS, Arial or other fonts, that are commonly used on web to display Slovenian language properly. UTF-8 encoding usually comes enabled as standard option in Prestashop. Also in your BackOffice make sure you change Administration language to Slovenian - this is very important! (Translations are a disaster, but with some elbow grease, you can translate what you think you need) When testing out fonts, make sure the € sign also remains normal. In some cases fonts start displaying čšćđž, but € character gets lost. I hope this helps Link to comment Share on other sites More sharing options...
Housy Posted November 14, 2013 Share Posted November 14, 2013 Hi ZaLuno, i have changed charset to "freeserif" and it is ok for now. I'm gonna use other font as you suggested. Thanks Housy Housy, On our site we solved the problem by using different font. I reccomend Trebuchet MS, Arial or other fonts, that are commonly used on web to display Slovenian language properly. UTF-8 encoding usually comes enabled as standard option in Prestashop. Also in your BackOffice make sure you change Administration language to Slovenian - this is very important! (Translations are a disaster, but with some elbow grease, you can translate what you think you need) When testing out fonts, make sure the € sign also remains normal. In some cases fonts start displaying čšćđž, but € character gets lost. I hope this helps Link to comment Share on other sites More sharing options...
mbp Posted November 14, 2013 Share Posted November 14, 2013 (edited) How can i make the deliveryadress alwas stay on the right side? I use a Single Integrated Label Style C so deliveryadress must stay on same place. Using 1.5.6.0 orginal .tmpl ---------- I solved it my self. Edited November 17, 2013 by mbp (see edit history) Link to comment Share on other sites More sharing options...
ZaLuno Posted November 16, 2013 Share Posted November 16, 2013 Is it possible, to add some labels to numbers? like this: John Doe Company Ltd. Vat no.: 34567890 Address Street 15 5000 City Slovenia Phone: 30554466 I was browsing through the invoice.tpl code and apparently invoice address is called from elsewhere. I see two solutions: 1. Find that elsewhere and add labels {l s='Vat no.' pdf='true'} and {l s='Phone' pdf='true'}. 2. Break apart (or replace) the {$invoice_address} into {$firstname} {$lastname} <br /> {$company} <br /> {l s='Vat no.' pdf='true'} :{$vat_number} <br /> {$address1} <br /> {address2} <br /> {$postcode} {$city} <br /> {$countryName} <br /> {l s='Phone' pdf='true'}: {$phone_number} Can someone point me in the right direction? I really need this fixed because of the laws and accounting issuies such unmarked numbers bring. Please anyone? This is very important and I believe that I am not the only user needing this ... Link to comment Share on other sites More sharing options...
tuk66 Posted November 18, 2013 Share Posted November 18, 2013 Look at Adress Format under Countries. Link to comment Share on other sites More sharing options...
maio Posted November 21, 2013 Share Posted November 21, 2013 @MerseyRay instead of using this <tr><td style="width: 50%; text-align: right">Invoice Number :</td><td style="text-align: left">{$title|replace:'Invoice #':'':'htmlall':'UTF-8'}</td></tr> try <tr> <td style="text-align: left">{$title|replace:'Invoice #':'Invoice Number :':'htmlall':'UTF-8'}</td> </tr> I think the replace function is better off ... Link to comment Share on other sites More sharing options...
Leez300 Posted November 26, 2013 Share Posted November 26, 2013 Hi Got a problem. I have placed an img src html code in pdf/invoice.tpl (and the image itself in the same folder). And then got the error "TCPDF ERROR: [image] Unable to get image: 8x8t.gif" in BO orders. Then I removed the image coding in invoice.tpl, expecting the error to disappear, but it didn't..! Pls, what to do? Ver. 1.5.4.1 Lee Link to comment Share on other sites More sharing options...
satinder Posted December 3, 2013 Share Posted December 3, 2013 Everything went ok as per the solution provided , I was curious if we can have Serial Number of Products in Product Tab List (Right Aligned) and some good CSS so that it looks a real professional Invoice Link to comment Share on other sites More sharing options...
Orange35 Posted December 4, 2013 Share Posted December 4, 2013 Hi Got a problem. I have placed an img src html code in pdf/invoice.tpl (and the image itself in the same folder). And then got the error "TCPDF ERROR: [image] Unable to get image: 8x8t.gif" in BO orders. Then I removed the image coding in invoice.tpl, expecting the error to disappear, but it didn't..! Pls, what to do? Ver. 1.5.4.1 Lee clear cache? Link to comment Share on other sites More sharing options...
enigma7291 Posted December 21, 2013 Share Posted December 21, 2013 Hello! how can i add shop info to the invoice! I found these variables e.g.: {$shop_address|escape:'htmlall':'UTF-8'} {$shop_details|escape:'htmlall':'UTF-8'} ... but every info appear in one line. I would like to see the values: shop name address tel: fax: etc: which variable can i get these info ? Link to comment Share on other sites More sharing options...
Rebel Tech Posted January 3, 2014 Share Posted January 3, 2014 Here we are if you want you can share your work on this page I think this is a very nice option for people Link to comment Share on other sites More sharing options...
Ganesh Hipparkar Posted January 3, 2014 Share Posted January 3, 2014 Hello every one, In Orders->Invoices menu when we generate pdf file by date at that time all orders between two dates are printed in invoice file. what i want is show a All Order Total: variable at the last page of the pdf and show there all orders total. Thanks, Ganesh Link to comment Share on other sites More sharing options...
martin776019 Posted January 4, 2014 Share Posted January 4, 2014 I have an empty space in the footer, how do I remove it? please help, thank you. Link to comment Share on other sites More sharing options...
enigma7291 Posted January 6, 2014 Share Posted January 6, 2014 Hello! workaround for the #141 problem! In the suitable place I inserted this: {$shop_address|replace:'-':"<br>"} Because the {$shop_address} variable contain the info "-" separated, thus the above modifier will brake new line the info ! Link to comment Share on other sites More sharing options...
Ganesh Hipparkar Posted January 7, 2014 Share Posted January 7, 2014 Hi, how to display a text at the last page of pdf while generating invoice.text should be display before the footer. some one help please. Thank you Ganesh Link to comment Share on other sites More sharing options...
edoluz Posted February 17, 2014 Share Posted February 17, 2014 Here we are if you want you can share your work on this page Thank you very very much for this page! I downloaded the Supremacy2k (Author: Supremacy2k) and it's a great solution for my needs! Thank you! Link to comment Share on other sites More sharing options...
shroom Posted February 19, 2014 Share Posted February 19, 2014 (edited) I'd like to use the country iso code on the invoice.tpl file, taking advantage of the "country" object already declared in the "HTMLTemplateInvoice" file, though assigning the "iso code" to smarty crashes the pdf generation. Any clue on how to properly send the iso code value to the tpl file? Edited February 19, 2014 by shroom (see edit history) Link to comment Share on other sites More sharing options...
kalakrima Posted February 24, 2014 Share Posted February 24, 2014 (edited) Hi everybody, All those usefull informations helped me a lot, thank you! But I have a very weird issue with PDF invoice. The euro symbol and sometimes french accents doesn't displays correctly. I spent five hours to search a solution for this issue and didn't find it. So I hope that you can help me. Firstly, I thought that is because I've made some changes to the template, so I've installed a new fresh version of prestashop 1.5.6.2 without any modifications, but the problem was the same. I've looked in the Php admin, the table are well coded un UTF-8, the prices displays correctly on front office, but not in the invoice... You can see the picture attached bellow of this issue. Can you tell me, please, how to solve this issue? Edited February 24, 2014 by kalakrima (see edit history) Link to comment Share on other sites More sharing options...
kalakrima Posted February 24, 2014 Share Posted February 24, 2014 Hi everybody, All those usefull informations helped me a lot, thank you! But I have a very weird issue with PDF invoice. The euro symbol and sometimes french accents doesn't displays correctly. I spent five hours to search a solution for this issue and didn't find it. So I hope that you can help me. Firstly, I thought that is because I've made some changes to the template, so I've installed a new fresh version of prestashop 1.5.6.2 without any modifications, but the problem was the same. I've looked in the Php admin, the table are well coded un UTF-8, the prices displays correctly on front office, but not in the invoice... You can see the picture attached bellow of this issue. Can you tell me, please, how to solve this issue? Ok, it's really weird... When I open my file with other program then Acrobat, everything seems ok, but when I'm opening it with Acrobat, my currency symbol is replaced by this weird sign.. Somebody know how to fix this? My acrobat version is the last. Link to comment Share on other sites More sharing options...
tuk66 Posted February 25, 2014 Share Posted February 25, 2014 PDF files can contain fonts used in the document. Sometimes just trust PDF reader that fonts are already installed. This issue is about the fonts. Used, enclosed, installed. Search this way. A small note. The M4 PDF Extensions module always include fonts for all characters in document. Then there are absolutely no problems with fonts. Link to comment Share on other sites More sharing options...
kalakrima Posted February 25, 2014 Share Posted February 25, 2014 PDF files can contain fonts used in the document. Sometimes just trust PDF reader that fonts are already installed. This issue is about the fonts. Used, enclosed, installed. Search this way. A small note. The M4 PDF Extensions module always include fonts for all characters in document. Then there are absolutely no problems with fonts. Hi, thank you for your help. I resolved the problem with Acrobat by setting "dejavusans" font by default for PDF Generator. May be this could help anyone in my case. Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted March 2, 2014 Share Posted March 2, 2014 (edited) hi rhapsody, can i use the same solution for prestashop 1.5.6.1 , i have tried your solution but i am not getting anything... can you provide the solution.. what i did is ? override the htmltemplateinvoice file, and posted the message display value in pdf/invoice.tpl file, but i am not getting the customer comments in invoice.. Edited March 2, 2014 by karthik who_am_i (see edit history) Link to comment Share on other sites More sharing options...
Rhapsody Posted March 2, 2014 Share Posted March 2, 2014 hi rhapsody, can i use the same solution for prestashop 1.5.6.1 , i have tried your solution but i am not getting anything... can you provide the solution.. what i did is ? override the htmltemplateinvoice file, and posted the message display value in pdf/invoice.tpl file, but i am not getting the customer comments in invoice.. I am using this solution on 1.5.6.2 and previously on 1.5.6.1 with no problem. Did you clear your cache and recompile using the BO under advanced options, performance? Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted March 2, 2014 Share Posted March 2, 2014 (edited) you have mentioned to paste the customer message in theme/pdf/invoice.tpl i have pasted in pdf/invoice.tpl and not in the themes/pdf directory no pdf directory in themes.. i will clear the cache and try.. Edited March 2, 2014 by karthik who_am_i (see edit history) Link to comment Share on other sites More sharing options...
Rhapsody Posted March 2, 2014 Share Posted March 2, 2014 Create the themes\your_theme_name\pdf and put any modified pdf template files there. That way whenever you upgrade your changes will not be overwritten. Link to comment Share on other sites More sharing options...
karthiiiiiiiiiik Posted March 2, 2014 Share Posted March 2, 2014 hi rhapsody it is working ... Thanks for your solution... Link to comment Share on other sites More sharing options...
patrmich Posted March 5, 2014 Share Posted March 5, 2014 Hi,In Prestashop 1.5.6, on the current pdf invoice default model, one column is entitled "Product / Reference"In such column :- the item reference value is missing- in the same cell, are the item title value and the attribute item value.I would like to know how to have 3 distinct columns : - one column for item Reference - one column for item title - one column for item attributeThank you in advance for any reply.Patrick Link to comment Share on other sites More sharing options...
weckie Posted March 5, 2014 Share Posted March 5, 2014 How can i get customers email on invoice and/or packing slip. I know how to get it in the adress field but i want it to display in some other area on invoice and slip. {$customer->email} does not work. thanks in advance. Link to comment Share on other sites More sharing options...
Torbz Posted March 11, 2014 Share Posted March 11, 2014 (edited) Hi, In Prestashop 1.5.6, on the current pdf invoice default model, one column is entitled "Product / Reference" In such column : - the item reference value is missing - in the same cell, are the item title value and the attribute item value. I would like to know how to have 3 distinct columns : - one column for item Reference - one column for item title - one column for item attribute Thank you in advance for any reply. Patrick Ditto with Patrick on this one - the product reference used to appear in a separate column (PS v1.3) but after upgrading recently, my client is complaining that the product reference is now missing, so it's more difficult for her to be sure of the item ordered, at a glance. See my next post for my solution Edited March 11, 2014 by Torbz (see edit history) Link to comment Share on other sites More sharing options...
Torbz Posted March 11, 2014 Share Posted March 11, 2014 (edited) (Relevant to v.1.5.6.2) Ok, Patrick sussed it out: In {install folder}/pdf/invoice.tpl is the following around line 129: <!-- PRODUCTS --> {foreach $order_details as $order_detail} {cycle values='#FFF,#DDD' assign=bgcolor} <tr style="line-height:6px;background-color:{$bgcolor};"> <td style="text-align: left; width: {if !$tax_excluded_display}35%{else}45%{/if}">{$order_detail.product_name}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="text-align: right; width: 20%; white-space: nowrap;"> {displayPrice currency=$order->id_currency price=$order_detail.unit_price_tax_excl} </td> I then added this to line 133 (Ref. {$order_detail.product_reference}) e.g. <td style="text-align: left; width: {if !$tax_excluded_display}35%{else}45%{/if}">{$order_detail.product_name} (Ref. {$order_detail.product_reference})</td> which gave me the product reference at the end of the item description. I know you want to create extra columns so you need to add a TD cell to the template around there to get the desired effect. Edited March 11, 2014 by Torbz (see edit history) Link to comment Share on other sites More sharing options...
patrmich Posted March 13, 2014 Share Posted March 13, 2014 Hi, Thank you to Torbz for the reply that worked well. 1- On the pdf invoice everything is translated into French except for the title of the column "Product". I did not find where to translate Product into Produit Any idea ? 2- On the pdf invoice is a column "Discount" (Réduction in French) Is there a way to display this column only when a discount has been applied ? Thank you in advance for any reply. Patrick Link to comment Share on other sites More sharing options...
fortuner Posted March 26, 2014 Share Posted March 26, 2014 Does anyone know how to add a customer message to invoice? Please, help Link to comment Share on other sites More sharing options...
Rhapsody Posted March 26, 2014 Share Posted March 26, 2014 Does anyone know how to add a customer message to invoice? Please, help The solution is in my Post #80 in this thread. Link to comment Share on other sites More sharing options...
fortuner Posted March 27, 2014 Share Posted March 27, 2014 The solution is in my Post #80 in this thread. Thank you, works perfect! One last question: html tags for bold text dont work, neither <b>, nor <strong>, not even <span style="font-weight: bold;"> Is that a common problem, or just mine? Link to comment Share on other sites More sharing options...
guessous Posted April 1, 2014 Share Posted April 1, 2014 (edited) thanks for your topic Hi evrebody plz i have this probmlem I have an empty space in the footer, how do I remove it? please help, thank you. Edited April 1, 2014 by guessous (see edit history) Link to comment Share on other sites More sharing options...
Onedirection Posted April 5, 2014 Share Posted April 5, 2014 Hi Supremacy2k, Thanks for sharing this guide. Could you please tell me where I can delete below text in the pdf invoice? It's about the VAT. I dont want it visible on the invoice. VAT details VAT % Total amount Total amount without VAT VAT Thanks for your help! Link to comment Share on other sites More sharing options...
tuk66 Posted April 7, 2014 Share Posted April 7, 2014 Disable getTaxTabContent() function in /classes/pdf/HTMLTemplateInvoice.php. To return '' is all right. Link to comment Share on other sites More sharing options...
roz Posted April 15, 2014 Share Posted April 15, 2014 hi! anyone knows how can i add in the Features in the product list add in Customer Name add in Delivery Date & Time add in Order Status in my Invoice. can anyone help me? thanks in advance Link to comment Share on other sites More sharing options...
donneljo Posted April 24, 2014 Share Posted April 24, 2014 How can i get customers email on invoice and/or packing slip. I know how to get it in the adress field but i want it to display in some other area on invoice and slip. {$customer->email} does not work. thanks in advance. I am trying to figure this one out too. Did you have any success with this? Link to comment Share on other sites More sharing options...
Onedirection Posted April 24, 2014 Share Posted April 24, 2014 Just try to change {$customer->email} to {email} or {mail} Link to comment Share on other sites More sharing options...
donneljo Posted April 24, 2014 Share Posted April 24, 2014 Just try to change {$customer->email} to {email} or {mail} No that just breaks the template Link to comment Share on other sites More sharing options...
mikemiranda Posted May 18, 2014 Share Posted May 18, 2014 (edited) Hello guys, can anyone help me put an image/icon on my template? a already tried <img src='{$img_dir}mail.png' alt='mail'> and <img src='mail.png' alt='mail'> on the same directory, but nothing works, please i had my template 90% done. Thanks in advance Edited May 18, 2014 by mikemiranda (see edit history) 1 Link to comment Share on other sites More sharing options...
tuk66 Posted May 19, 2014 Share Posted May 19, 2014 See the getLogo() function in the /classes/pdf/HTMLTemplate.php fiel how the full path for the logo is created. Link to comment Share on other sites More sharing options...
mikemiranda Posted May 20, 2014 Share Posted May 20, 2014 See the getLogo() function in the /classes/pdf/HTMLTemplate.php fiel how the full path for the logo is created. Sorry is not the logo i want is a simple image Link to comment Share on other sites More sharing options...
tuk66 Posted May 20, 2014 Share Posted May 20, 2014 I know but you can learn from that what works. Link to comment Share on other sites More sharing options...
eR3Ms Posted May 27, 2014 Share Posted May 27, 2014 (edited) Sorry, my mistake. Edited May 27, 2014 by eR3Ms (see edit history) Link to comment Share on other sites More sharing options...
patrikar Posted June 2, 2014 Share Posted June 2, 2014 Include order number in header / Have the header on all pages When using OP's solution for adding order number to the header of the PDF. Then the header doesn't show up on every page in the pdf but only the first. I got a solution for this problem. So that you can have order number in the header and at the same time have the header appearing on all pages. Step 1. In header.tpl do nothing! This could still be used for other PDF's than invoice. Step 2. In invoice.tpl, add your header code at the top. Something like the content of header.tpl with order number added. Step 3. In invoice.tpl, after your header code. Add this: <!-- END OF HEADER --> The top of invoice.tpl could now look like this: <table style="width: 100%"> <tr> <td style="width: 45%"> {if $logo_path} <img src="{$logo_path}" style="width:{$width_logo}px; height:{$height_logo}px;" /> {/if} </td> <td style="width: 5%"> </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%">Invoice</td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E"> </td> </tr> <tr> <td style="font-size: 14pt; color: #9E9F9E">{$order->getUniqReference()}</td> </tr> </table> </td> </tr> </table> <!-- END OF HEADER --> <!-- ADDRESSES --> <table ... Step 4. In /override/classes/pdf/PDFGenerator.php add the function createContent() like below: <?php class PDFGenerator extends PDFGeneratorCore { /** * * create the PDF content * @param string $content HTML */ /* Override: if header is provided in content, override the header */ public function createContent($content) { $pieces = explode('<!-- END OF HEADER -->', $content, 2); if( count($pieces) == 2 ) { $this->header = $pieces[0]; $this->content = $pieces[1]; } else { $this->content = $content; } } } Done! Link to comment Share on other sites More sharing options...
Supremacy2k Posted June 19, 2014 Author Share Posted June 19, 2014 Hi all! Nice to see my topic is still alive and kicking! :D 1 Link to comment Share on other sites More sharing options...
sderooy Posted July 8, 2014 Share Posted July 8, 2014 Hi Supremacy2k, you have done an awesome job with this tutorial! I do have a few questions, though, I hope you can help me with below questions. Attached is the invoice as it is set up now, what I want to change is the following: 1) The unit price "tax excl.GST " on one line (GST jumped to the line below) - so the same as Price (Incl. GST) and Total (Tax Incl.) 2) That same line with a grey background 3) The block with "Tax Details" - "tax rate" etc further down, it's too close to the actual invoice and doesn't look good (imo) Thanks a lot Sam 057.pdf Link to comment Share on other sites More sharing options...
Photonica Posted August 25, 2014 Share Posted August 25, 2014 Solved: How can customer messages be displayed in the pdf invoice? Jump to the bottom of this post for the solution - thanks to pointers from Bellini13! I'm looking for the method to display messages on the pdf invoice that are displayed in the order history and the BO order display. In the front office when a customer selects order history in the "My Account" block, the messages are displayed when they click on "details" in the order history table. This lead me to look at the code in order-details.tpl that displays the data on the screen. Below is that code that I tried to paste in the invoice.tpl file, but it didn't work. Any ideas how to make the messages display in the pdf invoice? {if count($messages)} <h3>{l s='Messages'}</h3> <div class="table_block"> <table class="detail_step_by_step std"> <thead> <tr> <th class="first_item" style="width:150px;">{l s='From'}</th> <th class="last_item">{l s='Message'}</th> </tr> </thead> <tbody> {foreach from=$messages item=message name="messageList"} <tr class="{if $smarty.foreach.messageList.first}first_item{elseif $smarty.foreach.messageList.last}last_item{/if} {if $smarty.foreach.messageList.index % 2}alternate_item{else}item{/if}"> <td> {if isset($message.elastname) && $message.elastname} {$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'} {elseif $message.clastname} {$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'} {else} <b>{$shop_name|escape:'htmlall':'UTF-8'}</b> {/if} <br /> {dateFormat date=$message.date_add full=1} </td> <td>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</td> </tr> {/foreach} </tbody> </table> </div> {/if} The solution: 1. Override the HTMLTemplateInvoice.php using the code below to place the customer messages in Smarty. This will lookup the messages, place assign them into smarty, and then return the standard invoice getContent. The file should be placed in the override/classes/pdf directory. <?php /* * Override for 1.5.4.1 HTMLTemplateInvoice.php to get order messages so they can be displayed in pdf invoice */ class HTMLTemplateInvoice extends HTMLTemplateInvoiceCore { public function getContent() { $this->smarty->assign(array( 'order' => $this->order, 'messages' => CustomerMessage::getMessagesByOrderId((int)($this->order->id), false), )); return parent::getContent(); } } 2. Insert the following code in the theme/pdf/invoice.tpl file. The location depends where you want the comments to display. For my invoice the code was inserted just before </table> <!-- / PRODUCTS TAB --> so the comments were displayed as the last item after the other sections of the invoice. <!-- / CUSTOMER MESSAGES --> <tbody> {if $messages} <b>Order Messages</b> {foreach from=$messages item=message name="messageList"} <tr class="{if $smarty.foreach.messageList.first}first_item{elseif $smarty.foreach.messageList.last}last_item{/if} {if $smarty.foreach.messageList.index % 2}alternate_item{else}item{/if}"> <hr><td> {if isset($message.elastname) && $message.elastname} {$message.efirstname|escape:'htmlall':'UTF-8'} {$message.elastname|escape:'htmlall':'UTF-8'} {elseif $message.clastname} {$message.cfirstname|escape:'htmlall':'UTF-8'} {$message.clastname|escape:'htmlall':'UTF-8'} {else} <b>{$shop_name|escape:'htmlall':'UTF-8'}</b> {/if} <br /> {dateFormat date=$message.date_add full=1} </td> <td>{$message.message|escape:'htmlall':'UTF-8'|nl2br}</td> </tr> {/foreach} {/if} </tbody> <!-- / CUSTOMER MESSAGES --> I need to do that in Prestashop 1.6. I added these code but not work, what can I do? Link to comment Share on other sites More sharing options...
franzneves Posted August 25, 2014 Share Posted August 25, 2014 me too Link to comment Share on other sites More sharing options...
Mochi09 Posted August 25, 2014 Share Posted August 25, 2014 hi, just want to ask if how I can put the (yard or yd) as my quantity measurement in my invoice, I want it to make like this Link to comment Share on other sites More sharing options...
aldoscully Posted September 24, 2014 Share Posted September 24, 2014 Good night. My prestashop 1.5.6.0 does not generate invoice. It may be because I deleted some of my order? Link to comment Share on other sites More sharing options...
tuk66 Posted September 24, 2014 Share Posted September 24, 2014 It happened just after deletion? Link to comment Share on other sites More sharing options...
stevent Posted September 24, 2014 Share Posted September 24, 2014 Hello everybody, I try to put a bakckground image on my invoice but it seem that it is deleted when the pdf is generated. Somebody can help me to do that? I did this on 1.6 : <div style="font-size: 8pt; color: #444; background-image: url('img/back_invoice3.png');"> <table> <tr><td> </td></tr> </table> thank you verryu much ! Link to comment Share on other sites More sharing options...
tuk66 Posted September 24, 2014 Share Posted September 24, 2014 It can be about DIV tag. http://stackoverflow.com/questions/11395171/why-does-tcpdf-ignore-my-inline-css Link to comment Share on other sites More sharing options...
aldoscully Posted September 24, 2014 Share Posted September 24, 2014 So, tuk66, I do not remember if it was removed soon after the requests for tests. See when I click to show the invoice id_order_invoice=55 but the invoice id is 70. http://unhasdefadaadesivos.com.br/adm/index.php?controller=AdminPdf&token=e0fd65dd91525b370391305c8429e991&submitAction=generateInvoicePDF&id_order_invoice=55 Link to comment Share on other sites More sharing options...
tuk66 Posted September 24, 2014 Share Posted September 24, 2014 We cannot access your Back Office without login. Link to comment Share on other sites More sharing options...
Şahin YILDIZ Posted October 11, 2014 Share Posted October 11, 2014 Header pdf invoice 2 page HOW? Link to comment Share on other sites More sharing options...
charalambos Posted October 18, 2014 Share Posted October 18, 2014 to highlight the description items in gray text in gray add ; background-color: #e3e3e3 in each of the lines for the discretion items Example number line <td style="text-align: left; width: 10%; font-weight: bold">Number</td> Becomes <td style="text-align: left; width: 10%; font-weight: bold; background-color: #e3e3e3">Number</td> on all lines <table style="width: 100%" cellspacing="2"> <tr style="line-height:4px;"> <td style="text-align: left; width: 10%; font-weight: bold; background-color: #e3e3e3">Number</td> <td style="text-align: left; width: 45%; font-weight: bold; background-color: #e3e3e3">{l s='Product / Reference' pdf='true'}</td> <!-- unit price tax excluded is mandatory --> {if !$tax_excluded_display} <td style="text-align: right; width: 12%; font-weight: bold; background-color: #e3e3e3">{l s='Unit Price' pdf='true'} {l s='(Tax Excl.)' pdf='true'}</td> {/if} <td style="text-align: right; width: 12%; font-weight: bold; background-color: #e3e3e3"> {l s='Unit Price' pdf='true'} {if $tax_excluded_display} {l s='(Tax Excl.)' pdf='true'} {else} {l s='(Tax Incl.)' pdf='true'} {/if} </td> <td style="text-align: right;width: 6%; font-weight: bold; background-color: #e3e3e3">{l s='Qty' pdf='true'}</td> <td style="text-align: right;width: 15%; font-weight: bold; background-color: #e3e3e3"> Link to comment Share on other sites More sharing options...
ldon Posted October 18, 2014 Share Posted October 18, 2014 Is possible to display all shop informations at the top of an invoice? Example: SHOP NAME Address Address 1 Reg. No.: Phone: ... Link to comment Share on other sites More sharing options...
tuk66 Posted October 19, 2014 Share Posted October 19, 2014 Look at all shop related Smarty variables in the getFooter method (/classes/pdf/HTMLTemplate.php) and put them to the getHeader method. Link to comment Share on other sites More sharing options...
ldon Posted October 19, 2014 Share Posted October 19, 2014 Look at all shop related Smarty variables in the getFooter method (/classes/pdf/HTMLTemplate.php) and put them to the getHeader method. Sorry for this question but how to replace the ' - ' with <br>? i $shop_address = AddressFormat::generateAddress($shop_address_obj, array(), ' - ', ' '); Thank you. Link to comment Share on other sites More sharing options...
tuk66 Posted October 20, 2014 Share Posted October 20, 2014 $shop_address = str_replace("|", "<br>", AddressFormat::generateAddress($shop_address_obj, array(), '|', ' ')); Link to comment Share on other sites More sharing options...
ldon Posted October 20, 2014 Share Posted October 20, 2014 $shop_address = str_replace("|", "<br>", AddressFormat::generateAddress($shop_address_obj, array(), '|', ' ')); It doesn't work in the invoice generator. Link to comment Share on other sites More sharing options...
ldon Posted October 24, 2014 Share Posted October 24, 2014 Any ideas how to display a store informations in format: SHOP NAME Address Address 1 Reg. No.: Phone: below a store logo? Thank you. Link to comment Share on other sites More sharing options...
edoluz Posted October 24, 2014 Share Posted October 24, 2014 Hello. I don't know if this TPL can help you but it's the template we're using in our shop. It's in Italian, but you can easily trasnlate it. Hope it helps you. Have a try and give me a feedback. Bye,Edo invoice.zip Link to comment Share on other sites More sharing options...
ldon Posted October 25, 2014 Share Posted October 25, 2014 Hello. I don't know if this TPL can help you but it's the template we're using in our shop. It's in Italian, but you can easily trasnlate it. Hope it helps you. Have a try and give me a feedback. Bye, Edo I do need a shop address in a format of a delivery address. Link to comment Share on other sites More sharing options...
ldon Posted October 30, 2014 Share Posted October 30, 2014 Any idea please. 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