istox Posted August 28, 2010 Posted August 28, 2010 I'm newbie in this. Please help. How to edit PDF content of the invoice. I want to insert there:Company NameAdressBank RequisitesPhone NumberAnd emailAny ideas fellows? Share this post Link to post Share on other sites More sharing options...
rocky Posted August 29, 2010 Posted August 29, 2010 It's not easy to do unless you know how to program. You'll need to edit classes/PDF.php. PrestaShop uses FPDF, so reading about it will help. Share this post Link to post Share on other sites More sharing options...
istox Posted August 29, 2010 Posted August 29, 2010 Thanks for your help!But actually anyone can help me? I Need to insert:Company nameAddressBank RequisitesemailPhone Number Share this post Link to post Share on other sites More sharing options...
rocky Posted August 31, 2010 Posted August 31, 2010 Is it the information at the bottom of the invoice you want to change? If so, the code for it is at the bottom of the Footer() function in classes/PDF.php: $this->Cell(0, 5, $conf['PS_SHOP_NAME_UPPER']. (!empty($conf['PS_SHOP_ADDR1']) ? ' - '.self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '').' '.$conf['PS_SHOP_COUNTRY'] : ''), 0, 1, 'C', 1); $this->Cell(0, 5, (!empty($conf['PS_SHOP_DETAILS']) ? self::l('Details:').' '.$conf['PS_SHOP_DETAILS'].' - ' : ''). (!empty($conf['PS_SHOP_PHONE']) ? self::l('PHONE:').' '.$conf['PS_SHOP_PHONE'] : ''), 0, 1, 'C', 1); By default, it has the shop name, 'Headerquarters:' followed by the address, shop details and phone number. If you don't want to modify code, you can enter the extra information on the Preferences > Contact tab in the "Registration" text area. Share this post Link to post Share on other sites More sharing options...
MrBaseball34 Posted August 31, 2010 Posted August 31, 2010 It's not easy to do unless you know how to program. You'll need to edit classes/PDF.php. PrestaShop uses FPDF, so reading about it will help. rocky, I think they changed to TCPDF a while ago. Share this post Link to post Share on other sites More sharing options...
rocky Posted August 31, 2010 Posted August 31, 2010 In PrestaShop v1.3.1, classes/PDF.php includes tools/fpdf/fdpf.php. Did they change it in PrestaShop v1.4? Share this post Link to post Share on other sites More sharing options...
istox Posted August 31, 2010 Posted August 31, 2010 Thanks! But not in the bottom. In the bottom is everything Ok.And I don't want to change. I want to insert new info. Just text in column.I attached screenshot where i want to put my info. Please help with the code of inserting. And advice the lines number... Share this post Link to post Share on other sites More sharing options...
MrBaseball34 Posted August 31, 2010 Posted August 31, 2010 In PrestaShop v1.3.1, classes/PDF.php includes tools/fpdf/fdpf.php. Did they change it in PrestaShop v1.4? You are right, I guess I got it backwards...even in 1.2.5 it is FPDF.Hmmm... Share this post Link to post Share on other sites More sharing options...
rocky Posted September 1, 2010 Posted September 1, 2010 To add the content below the addresses, you'll need to put the code before the /* display order information */ section one line 424 of classes/PDF.php (in PrestaShop v1.3.1). Add the following: $pdf->Ln(5); $pdf->Cell(0, 6, self::l('Put your content here')); Share this post Link to post Share on other sites More sharing options...
Patric Posted September 1, 2010 Posted September 1, 2010 Topic moved. Share this post Link to post Share on other sites More sharing options...
Vaidas Posted November 27, 2010 Posted November 27, 2010 Hi Rocky,maybe you can help? I want to add in PDF invoice short product description.Now there is only product title. I use 1.3.2Thank's Share this post Link to post Share on other sites More sharing options...
HyperX Posted December 7, 2010 Posted December 7, 2010 Thansk this is working for me.But the text is now just plain, how do i get it bold en is it possible to change the size of the added text?Thanks Share this post Link to post Share on other sites More sharing options...
rocky Posted December 8, 2010 Posted December 8, 2010 Use code like the following to change the font size and style: $pdf->SetFont('Arial','B',16); This will code will set the font to Arial Bold 16pt. Share this post Link to post Share on other sites More sharing options...
youstar Posted December 16, 2010 Posted December 16, 2010 is it possible to remove these from the invoice:Total products (excl. tax)Total (excl. tax)TAX % Share this post Link to post Share on other sites More sharing options...
rocky Posted December 19, 2010 Posted December 19, 2010 To remove "Total products (tax excl.)" and "Total (tax excl.)", you will need to /* comment out */ lines 480-486 of classes/PDF.php: $pdf->Ln(5); $pdf->SetFont(self::fontname(), 'B', 8); $width = 165; $pdf->Cell($width, 0, self::l('Total products (tax excl.)').' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice($priceBreakDown['totalProductsWithoutTax'], self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); and lines 535-537: $pdf->Cell($width, 0, self::l('Total').' '.(self::$_priceDisplayMethod == PS_TAX_EXC ? self::l(' (tax excl.)') : self::l(' (tax incl.)')).' : ', 0, 0, 'R'); $pdf->Cell(0, 0, (self::$orderSlip ? '-' : '').self::convertSign(Tools::displayPrice((self::$_priceDisplayMethod == PS_TAX_EXC ? $priceBreakDown['totalWithoutTax'] : $priceBreakDown['totalWithTax']), self::$currency, true, false)), 0, 0, 'R'); $pdf->Ln(4); Share this post Link to post Share on other sites More sharing options...
youstar Posted December 19, 2010 Posted December 19, 2010 Do you mean just remove the fillings in those lines or copy pasting the above? Share this post Link to post Share on other sites More sharing options...
rocky Posted December 19, 2010 Posted December 19, 2010 You can remove the code specified above, but I prefer to comment out code to make it easier to track changes and have the option to uncomment code in the future. Share this post Link to post Share on other sites More sharing options...
stuffy Posted January 18, 2011 Posted January 18, 2011 Can you place an image in the background of the pdf? I was thinking maybe adding my shop logo as a watermark effect?! Share this post Link to post Share on other sites More sharing options...
beekhouse Posted June 14, 2011 Posted June 14, 2011 Hello,I wondered which code to remove to display only:total products (tax excl.)total products (tax incl.)total shippingtotal (tax incl.)So I want to get rid of the total of products and shipping tax excl. Share this post Link to post Share on other sites More sharing options...
airbag Posted June 28, 2011 Posted June 28, 2011 Rocky, is this the new code in 1.4 which displays the address at the top of the invoice?Does this code say not to show these things... ?In V 1.2.5 we used to get the customers phone number displaying under the address, and now it does not show on pdf invoices (in 1.4).Can you confirm how we can show the phone number please? $patternRules = array( 'avoid' => array( 'address2', 'company', 'phone', 'phone_mobile')); $addressType = self::generateHeaderAddresses($pdf, $order, $addressType, $patternRules, $width); Share this post Link to post Share on other sites More sharing options...
rocky Posted June 28, 2011 Posted June 28, 2011 Yes, that's the code that sets what is displayed and then calls the generateHeaderAddresses() functions to display it. I just tried clicking on the PDF icon next to an order on my website and the phone number is displayed under the addresses. I don't understand why it isn't working for you. Share this post Link to post Share on other sites More sharing options...
istox Posted June 28, 2011 Posted June 28, 2011 Please can somebody help with my post http://www.prestashop.com/forums/viewthread/116596/ Share this post Link to post Share on other sites More sharing options...
ro6er Posted August 25, 2011 Posted August 25, 2011 How do you pull in a field from another table into the pdf. For example something from a custom module that I'd like to added which lives here: table: ps_order_paymentcard col: cardholdername I tried an sql query and it only worked under the order tab and not the email, here's what I did: $orderid1 = $order->id; $result = mysql_query("SELECT * FROM ps_orders INNER JOIN ps_order_paymentcard ON ps_orders.id_order = ps_order_paymentcard.id_order WHERE ps_orders.id_order = $orderid1") or die(mysql_error()); $pdf->Cell($width, 10, self::l('Customer order number:').$row['cardholdername']); there must be an easier way to do what I'm trying to achieve. Roger Share this post Link to post Share on other sites More sharing options...
akaeu Posted August 30, 2011 Posted August 30, 2011 Yes, that's the code that sets what is displayed and then calls the generateHeaderAddresses() functions to display it. I just tried clicking on the PDF icon next to an order on my website and the phone number is displayed under the addresses. I don't understand why it isn't working for you. Same problem for me with presta 1.4 (not in English language) - phone number is not shown in the invoice. Any solution ? Also the state is not shown. I thought it was from the presta table ps_address_format but no . Share this post Link to post Share on other sites More sharing options...
rocky Posted August 31, 2011 Posted August 31, 2011 I just tried viewing some of the PDF invoices on my own PrestaShop v1.4.4.1 website and it displays the phone numbers underneath the addresses at the top. My classes/PDF.php file also has 'phone' in the 'avoid' variable, yet the phone number is displayed. Try going to Shipping > Countries, edit the customer's country and make sure the address layout has 'phone' at the end. 1 Share this post Link to post Share on other sites More sharing options...
akaeu Posted August 31, 2011 Posted August 31, 2011 On Shipping -> Country for my country I had firstname lastnamecompany vat_number address1 address2 postcode city Country:name phone Now it's look like this firstname lastnamecompany vat_number address1 address2 postcode city State:name Country:name phone phone_mobile An it's working. Thank's for the tip. I was used to modify directly in the DB , I wasn't used to play with this area Shipping > Countries, where I found how exactly I had to put the state and mobile phone.For me the problem is [sOLVED] Share this post Link to post Share on other sites More sharing options...
Klas Posted September 6, 2011 Posted September 6, 2011 Thanks! Helped me solve my problem aswell... Share this post Link to post Share on other sites More sharing options...
sanjiovanilx Posted September 7, 2011 Posted September 7, 2011 Is it the information at the bottom of the invoice you want to change? If so, the code for it is at the bottom of the Footer() function in classes/PDF.php: $this->Cell(0, 5, $conf['PS_SHOP_NAME_UPPER']. (!empty($conf['PS_SHOP_ADDR1']) ? ' - '.self::l('Headquarters:').' '.$conf['PS_SHOP_ADDR1'].(!empty($conf['PS_SHOP_ADDR2']) ? ' '.$conf['PS_SHOP_ADDR2'] : '').' '.$conf['PS_SHOP_CODE'].' '.$conf['PS_SHOP_CITY'].((isset($conf['PS_SHOP_STATE']) AND !empty($conf['PS_SHOP_STATE'])) ? (', '.$conf['PS_SHOP_STATE']) : '').' '.$conf['PS_SHOP_COUNTRY'] : ''), 0, 1, 'C', 1); $this->Cell(0, 5, (!empty($conf['PS_SHOP_DETAILS']) ? self::l('Details:').' '.$conf['PS_SHOP_DETAILS'].' - ' : ''). (!empty($conf['PS_SHOP_PHONE']) ? self::l('PHONE:').' '.$conf['PS_SHOP_PHONE'] : ''), 0, 1, 'C', 1); By default, it has the shop name, 'Headerquarters:' followed by the address, shop details and phone number. If you don't want to modify code, you can enter the extra information on the Preferences > Contact tab in the "Registration" text area. Great! This is very helpful, I applied it then it works fine. Thanks for your help! Share this post Link to post Share on other sites More sharing options...
Rain_xx Posted October 12, 2011 Posted October 12, 2011 Hi! I would like to add some words in the address displayed at the top of the invoice, as 'Phone': how can I do this? thanks. Share this post Link to post Share on other sites More sharing options...
fgord Posted October 15, 2011 Posted October 15, 2011 Hi Everybody, I need help for 2 problems: 1- I have a problem with Tax detail. The Pre-tax total is incorrect. It seems to pick up the price of the last product instead on Total products (tax excl.). See image. 1- I wish to remove: Total products (tax incl.). I tried the method mentioned by Rocky (post #9) but it didn't work. Is there any other way? Share this post Link to post Share on other sites More sharing options...
fgord Posted October 15, 2011 Posted October 15, 2011 Sorry. Here is the image. Thanks a lot in advance! Share this post Link to post Share on other sites More sharing options...
tuk66 Posted October 18, 2011 Posted October 18, 2011 1- I wish to remove: Total products (tax incl.). I tried the method mentioned by Rocky (post #9) but it didn't work. Is there any other way? Locate set of 5 lines in your /classes/PDF.php file with text: Total products (tax incl.) and remove all. Share this post Link to post Share on other sites More sharing options...
reloaded Posted October 19, 2011 Posted October 19, 2011 Hi! I would like to add some words in the address displayed at the top of the invoice, as 'Phone': how can I do this? thanks. i would like to do it too... possible that everyone of you leaves data without any specification? i have VAT, address and phone numbers on my PDF documents which seems honestly to be throwed on the paper without any words that explain what the VAT number is or what kind on phone number you are looking at (mobile or others?) so i would like to have on the pdf something like: VAT number: "VAT number coming from prestashop" Mobile phone: "mobile phone coming from prestashop" Thx Share this post Link to post Share on other sites More sharing options...
tuk66 Posted October 19, 2011 Posted October 19, 2011 i would like to do it too... possible that everyone of you leaves data without any specification? ... so i would like to have on the pdf something like: VAT number: "VAT number coming from prestashop" Mobile phone: "mobile phone coming from prestashop" Thx It is easy to say and do badly. Ways to do this are many. I'm sorry. For more complex PDF invoice editing I only choose M4 PDF Extensions module and adaptation of one of its templates. It's quick and easy. Share this post Link to post Share on other sites More sharing options...
reloaded Posted October 19, 2011 Posted October 19, 2011 If every time someone suggested me to buy a module... Prestashop, which is basically free, would cost me much more than a non-free e-commerce solution. Any other solution? Share this post Link to post Share on other sites More sharing options...
janaro Posted March 21, 2012 Posted March 21, 2012 Could anyone point this PHPwannabe with 1.4.6.2 how to add discounts in my invoices/cart? Thanks in advance! Share this post Link to post Share on other sites More sharing options...
ellimac Posted May 22, 2013 Posted May 22, 2013 hi.. i need help.. how can i delete the total vouchers and the shipping cost in the pdf file of invoice? thank you for your help! Share this post Link to post Share on other sites More sharing options...
ramesh90 Posted May 22, 2013 Posted May 22, 2013 Hello, If there any possible to generate order invoice in excel format,anybody have idea let me know.. thanks in advance.. Share this post Link to post Share on other sites More sharing options...
Bejo Posted July 21, 2013 Posted July 21, 2013 i need remove tax excl. text on pdf invoice... where i can find the code? already searching but not fix it yet Share this post Link to post 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