Guest Posted December 8, 2006 Posted December 8, 2006 Hi I am using PDF Invoice V1.4 and need to add Customer Telephone no and Email To invoice. Thanks in advance...
wangotango Posted December 11, 2006 Posted December 11, 2006 Here's an example for the phone number: First, back up your /admin/invoice.php and /admin/includes/languages/english/invoice.php files (if you're supporting more than one language, do the same for your other language folders). Next, open the /admin/invoice.php file. Now, this example will just display the number on the screen, but you'll need to tweak the position to put it where you want it on the page. I'm going to position it under the Sold To address on my form. Find the section that begins with the comment [/b]//Draw the invoice address text (around 150-160 in my file). Under this section, find the line that begins $pdf->MultiCell(... (This should be right above the Draw Box for Delivery Address section). Immediately after this line, enter the following:$pdf->SetTextColor(0); $pdf->SetFont('Arial','',9); $pdf->Text(12,80,ENTRY_PHONE.' '.$order->customer['telephone']); Save the file, and then open the /admin/includes/languages/english/invoice.php file. Add a new definition for the phone number (replace "Phone:" with something else if you prefer):define('ENTRY_PHONE', 'Phone:'); Save this file as well. Upload both files. and then load an invoice. You should now see the phone number. Chances are, you'll need to reposition the number on the page (my invoice is a bit customized). In the line that begins $pdf->Text(12,80,..., tweak those first two numbers to change the position. The first number is the X coordinate (from page left), the second, the Y coordinate (from page top). To add the email, repeat the above, but create an ENTRY_EMAIL in the languages file, and call $order->customer['email_address'] in the Text line. Also, you do not need the SetTextColor(0); and SetFont lines if these are set above this section in a style you like...the only key line you need is the $pdf->Text(etc., etc. Don't forget to update any other language files you might be using! WangoTango
Recommended Posts
Archived
This topic is now archived and is closed to further replies.