How to Add Payment Details to your WHMCS PDF Invoices
WHMCS provides some documentation on how to customise your PDF Invoices. Their article includes some specific pointers to help you add your own logo, and it gives an overview of the available variables which I found useful… however for the uninitiated or PHP-challenged I can imagine that doing something simple like adding available payment methods to your invoices would remain a mystery. So, here’s a simple tutorial you can follow to add payment details to your WHMCS PDF invoices.
Click here to see what we’re creating – a nice PDF invoice with details on how to pay in 3 columns across the bottom.
- Locate your active WHMCS template folder. The easiest way to do that is to log in to your WHMCS install and go to Settings > General Settings, and check the name of the folder that appears in the Template drop-down as pictured below:
- Now, in your FTP client find invoicepdf.tpl in your active Template folder. This is the template we’re going to edit to control what appears on your PDF invoices.
- Copy the following code into invoicepdf.tpl before the closing
#Payment Method $pdf->SetFont('freesans','B',12); $pdf->Cell(0,4,"HOW TO PAY",0,1,'C'); $pdf->Ln(5); $pdf->SetFont('freesans','',9); $paymethhtml = '
Please send cheque payable to:
Your Company Name
XXX Something St
Account Name: XXXX
Account No: XXXXXXXX
Please phone us with your card details to pay with Visa or Mastercard
You’ll notice we’re telling it to use freesans font – you can customise or remove that as needed. Remember to substitute in your own postal address and bank account details so your customers can pay you.
- Once you’ve customised the payment details you’re ready to save and upload back to your Template folder via FTP
- Test it… Tweak it. Once you’re happy, you’re done!
Note that this just adds your payments details to the PDF version of invoices. You may also want to add your details to the ‘invoice created’ email that client’s get sent (this can be done via WHMCS Settings > Email Templates) and on the version of the invoice that appears in the client portal area (this can be done in viewinvoice.tpl in the active templates folder).
Full copy of our customised invoicepdf.tpl file here.