We offer 24X7 Dependable WHMCS Technical Support and Maintenance Services for web hosting startups and enterprises to keep their WHMCS website updated, bug-free and flawless.

seen from Malaysia
seen from France
seen from China
seen from China

seen from Germany
seen from Australia

seen from Malaysia
seen from United States
seen from United States
seen from United States
seen from Yemen
seen from Germany

seen from Italy
seen from Maldives
seen from India

seen from Italy

seen from Italy

seen from India

seen from Hong Kong SAR China

seen from India
We offer 24X7 Dependable WHMCS Technical Support and Maintenance Services for web hosting startups and enterprises to keep their WHMCS website updated, bug-free and flawless.
Learn about Invoicing issues in WHMCS
There may be occasions where invoices are not generated as expected by the system. The problem is usually a misconfiguration or human error, this page explains the symptoms, causes and resolutions to the most common invoicing problems.
Invoices/Payment Reminders not Generated
First please ensure the Overdue Notices option in unticked on the client's Profile tab, ticking the option will prevent overdue notices being sent to the client.
If the Email Templates are not present then the system will be unable to send an email, so review Setup > Email Templates and ensure the Invoice Created and Overdue Notice emails templates are listed.
Invoice generation, payment reminders and account suspension/termination are some of the tasks handled by the daily cron job in accordance with your Automation Settings. If you find that some or none of the above are occurring then this could indicate the cron job is not running successfully.
Begin by reviewing Utilities > Logs > Activity Log and ensure you see a number of entries beginning "Cron Job" each day. The final entry every day should be "Cron Job: Completed".
If you see no Cron Job entries at-all this means you have not configured your automation cron correctly, you must do this per our installation instructions. The relevant documentation can be found at cron job.
If you see some Cron Job entries but none after "Cron Job: Running Usage Stats Update" your cron is getting stuck at the Usage Stats Update stage. The most likely cause of this error is that you have an old server in Setup > Servers that is no longer available. To resolve this, you should update or remove any inactive or offline servers from Setup > Servers so that they can all be connected to successfully. Or alternatively Update Usage Statistics can be disabled under Setup > Automation Settings.
Finally, if you see some Cron Job entries but no "Cron Job: Completed" entry this suggests the cron is being terminated prematurely by your server. Please increase the memory_limit setting in your server's php.ini to 64M or 128MB which should easily be sufficient. Then see if things improve and you start getting the cron job report again over the next few days.
If the cron still doesn't complete with the increased memory limit please ensure display_errors is enabled in the server's PHP configuration and enable the Setup > General Settings > Other tab > Display Errors option, then run the cron manually by visiting the cron.php file in your browser. You should now see an error output to the screen. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:
Server Modules
Domain Registrars
Common_Troubleshooting_Tips#Server_Errors
Items Not Invoicing
There are a couple of reasons for invoices not generating, the most obvious are that there's a cancellation request for the service or it's in cancelled, terminated, fraud or expired status. For domains the Disable Auto Renew option could be ticked which stops renewal invoices being generated automatically. It could also be that thecron job is not being run, please refer to the above to check that.
Invoices are only generated once the service's Next Due Date is within the Setup > Automation Settings > Invoice Generation value, so if the Next Due Date is n the future no invoice will be generated. For example if today's date is 01/01/2012:
Next Due Date: 07/01/2012 Invoice Generation: 7 = Invoice will generate.
Next Due Date: 08/01/2012 Invoice Generation: 7 = Invoice not generated.
If it's none of those then it's possible an invoice was generated but then deleted by a member of staff - you'd need to check the client's Log tab for any Invoice Deleted or Order Deleted entries. WHMCS never generates duplicate invoices for the same service on the same due date, so if a new invoice is required after deleting an invoice you would need to manually move the Next Due Date forward/back by 1 day. Doing this should get invoice generation going again.
Double Invoices/Charges/Blank Invoices
There are several invoicing issues all caused by a common misconfiguration, the symptoms are; two invoices being generated for the same service and due date, a client being double-charged for the same invoice or a completely blank invoice being generated.
This is caused by the cron job being run twice at the same time, the cron should only be run once per day and never simultaneously. To confirm this review Utilities > Logs > Activity Log there should only be one "Cron Job: Completed" entry per day. If there is more than one check the server's cron job configuration to ensure there is only one entry for the cron.php file in accordance with our our documentation.
Tax Not Applied to Invoices
If tax is not applied to an invoice this means WHMCS believe it is not eligible under your tax rules. First ensure tax is enabled and the relevant Apply Tax options are ticked on the Tax Rules page, if it's an invoice for a product ensure this option is ticked in the product configuration.
Secondly ensure the Tax Exempt checkbox is unticked on the client's Profile tab. This may have been ticked by a member of staff or our VAT Invoicing Addon Module (if installed).
Finally the client might not match any of your tax rules, the state/country must be an exact match and is case sensitive. So for example if a tax rule exists for the state "TX" and the client's state is "Texas" these do not match and therefore tax would not be applied. Therefore two tax rules would be required, one for "TX" and another for "Texas". Any changes will be applied to subsequent invoices, existing invoices will not be changed.
Multiple Invoices for the same Service
Multiple invoices for the same service but with different due dates may be generated if the service has a due date in the past. This usually occurs with services imported using the WHM/cPanel importer or services added manually by a member of staff where the Next Due Date is left at 00/00/0000. As this due date is in the past WHMCS is generating all invoices between then and today to ensure the client is fully paid up.
To correct this change the Next Due Date to the date of the client's next payment via their Products/Services tab. Any erroneous invoices can safely be deleted/cancelled.
Support by
Waxspace Team
Troubleshooting Guide to resolve common errors in WHMCS
This guide will explain and help resolve many of the most common error messages that can occur whilst using WHMCS. Before contacting support please run through this step-by-step guide as you may be able to resolve the matter yourself.
Known Bugs
Sometimes issues are identified between releases and individual patches are published outside the update structure which can be applied if you are experiencing the symptoms. Please review the Patches sticky threads in ourTechnical Issues and Questions (free registration required) as a fix for your issue may already be available.
Module Command/Registrar Error
Module Command Errors are errors returned from the module and not WHMCS, so for provisioning modules (cPanel, Plesk etc) they come from your server, for registrar modules (eNom, ResellerClub etc) they come from your domain registrar.
Therefore to discover the cause of such errors refer to your server/registrar's documentation or support team. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:
Server Modules
Domain Registrars
Common_Troubleshooting_Tips#Server_Errors
Once the necessary corrections have been made use the Module Command buttons under the client's Products/Services or Domains tabs to attempt the command again.
Unknown Error
Sometimes the module returns an error WHMCS isn't expecting and this can result in an Unknown Error message. In these cases the System Module Debug Log should be used to obtain the full response from the module. This will contain an error message that the server/registrar's documentation or support team will be able to explain.
Blank/Partially Loading Page
If at any time you encounter a blank page in the WHMCS system ensure display_errors is enabled in the server's PHP configuration and enable the Setup > General Settings > Other tab > Display Errors option, then reproduce the blank page problem.
You should now see an error output to the screen. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:
Server Modules
Domain Registrars
Common_Troubleshooting_Tips#Server_Errors
If you are unable to access the admin area to enable this option, add the following line to your WHMCS configuration.php file instead and then reproduce the blank page problem. Once testing is complete, be sure to untick the option or remove the $display_errors line again from that file so that clients aren't getting warnings or errors.
$display_errors = true;
If you are running version 5.3.3 or later, and you are familiar with PHP's Error Reporting, you may customize which errors to render by using an error level bitmask.
/** * a (bool) true value will provide E_ALL ^ E_NOTICE ^ E_DEPRECATED ^ E_WARNINGS */ $display_errors = E_ALL ^ E_NOTICE;
If a blank page still occurs please refer to Blank Pages for further troubleshooting steps.
Payments Not Recorded
Should a payment not be recorded in WHMCS the first thing to check are the callback settings on your payment gateway's website to ensure it is configured to communicate with your WHMCS installation. As a rule callback commands should be sent to the appropriate file in the /modules/gateways/callback directory but specific instructions for individual gateways can be found at Payment Gateways.
If the configuration is correct navigate to Billing > Gateway Log and review the debug data at the time payment was made, this should display an error message or code which your payment gateway's documentation or support team will be able to explain. We have also collected some of the most most common errors and their causes, refer to the appropriate page in the Payment Gateways section.
If there is no log entry at-all and you are using a merchant gateway this suggests that the client has no card details on file. Otherwise it means your gateway is unable to communicate with the callback file on your server, a server setting such as the firewall or mod_security could be blocking them. Liaise with your payment gateway and server administrator to resolve such matters.
Support by
Waxspace Team
Learn to troubleshoot Blank Pages in WHMCS
If at any time you encounter a blank page in the WHMCS system then this indicates a fatal PHP error is occurring. This page explains the common causes of such problems, how to identify and subsequently resolve them.
General
Error display is turned off by default for security so in order to see what error is occurring, you need to enable error display. First please ensure display_errors is enabled in the server's PHP configuration and enable the Setup > General Settings > Other tab > Display Errors option, then reproduce the blank page problem.
You should now see an error output to the screen. We have collected some of the most most common errors and their causes, refer to the appropriate page in the following sections:
Server Modules
Domain Registrars
Common Troubleshooting Tips
If you are unable to access the admin area to enable this option, or you are running version 4 and earlier add the following line to your WHMCS configuration.php file instead and then reproduce the blank page problem. Once testing is complete, be sure to untick the option or remove the $display_errors line again from that file so that clients aren't getting warnings or errors.
$display_errors = true; $display_errors = E_ALL;
Often the error message will be explanatory enough for you to identify what the issue is. Common problems are errors in custom modules, hook code, template customisations & variables, or entirely missing/non-updated files.
Client Area Only
If the admin area is loading correctly and only the client area is blank this suggests the template folder missing or the /templates_c folder invalid path/not writeable.
To resolve this:
Re-select template under Setup > General Settings and clicking Save Changes.
Ensure the templates_c has the appropriate permissions/CHMOD and ownership values so it's writeable by the script (usually CHMOD 777).
If the /templates_c directory has been moved to a custom location ensure the path is correct in the configuration.php file. Your server admin/hosting provider will be able to confirm this.
Admin Login Page Only
The admin login page does not involve templates, so seeing a blank page here suggests a problem with the Ioncube configuration on your server. You can download the Ioncube Loader Wizard fromhttp://www.ioncube.com/loaders.php and upload to your whmcs directory, then visit it in your browser. Your server admin/hosting provider will need to resolve any errors it identifies.
If it reports Ioncube is installed correctly please ensure display_errors is enabled in the server's PHP configuration as this may be suppressing out error messages WHMCS is trying to output with the display_errors line in the configuration.php file detailed above.
Problematic custom widgets may also cause a blank page. Try removing any non-standard files from the/modules/widgets directory.
Admin Area Only
Blank pages in just the admin area are caused by renaming the 'admin' directory but not specifying the admin folder name in the configuration.php file. Ensure this has been done as described in our documentation.
Redirect Pages Only
When blank pages are only occurring on redirect pages such as shopping cart redirect to payment gateway page, or upon client/admin login this means a blank space is being output by the configuration.php or an action hook file.
Review the configuration.php file and ensure there are no blank spaces or carriage returns outside the <?php and ?> tags. The same goes for the files in the /includes/hooks directory.
Blank Pages Elsewhere
If blank pages are occurring on all pages, please try all the above steps, particularly enabling display_errors. If none of the above resolves the issue review any custom files in the following locations and ensure there are no blank spaces or carriage returns outside the <?php and ?> tags:
/configuration.php
/includes/hooks/
/modules/admin/
/modules/addons/
/modules/registrars/
/modules/servers/
/modules/widgets/
/lang/
/lang/overrides/
/admin/lang/
/admin/lang/overrides/
It may be necessary to remove any custom files from these locations temporarily, if doing so resolves the issue then you can add them back one-by-one until the problem re-occurs, you can then contact the vendor of the offending file for a fix.
If none of the steps on this page fix the problem then please contact our support team for assistance. In your support ticket please include the attempts you have made to resolve the issue, instructions to reproduce the blank page and FTP/SFTP access.
Support by
Waxspace Team
Learn Common Troubleshooting Tips for WHMCS
General Errors
Order Form Product Pricing doesn't match admin area
The product pricing on the order form does not match the pricing entered on the product's pricing tab in the admin area. This means Setup > General Settings > Ordering tab > Monthly Pricing Breakdown is enabled.
Blank Page
If at any time you encounter a blank page in the WHMCS system ensure display_errors is enabled in the server's PHP configuration, add then enable the Error Reporting option in Setup > General Settings > Other
You should then get an error output to the screen, the most common errors are explained further down this page or on the relevant Modules Page. Once testing is complete, be sure to turn the error reporting setting off again.
More comprehensive troubleshooting for blank pages issues can be found at Blank Pages.
Database Errors
Down for Maintenance - An upgrade is currently in progress
Seeing this error indicates that the version of the files do not match the version of your database. So for example the files uploaded might be for Version 4.4, but the upgrade script might not have been run yet so the database is still only setup for Version 4.3. To resolve this you need to do a full reupload of the current versions WHMCS files, and run through any upgrade process that is presented to you when doing that and once completed you will be able to access the system again. For the correct upgrade procedure, please refer to http://docs.whmcs.com/Upgrading
Critical Error - Unable to connect to the database
This error means your database cannot be connected to. Please check the database connection details in the configuration.php file and update as needed (for example, if you recently changed the password or renamed the database itself). This could also be an issue with MySQL being down or an empty configuration.php file.
If you have confirmed that the database name, user name and password are correct, ensure that the MySQL user has been assigned to the desired database and given full access to it, as this is needed for the connection to work. If you are unsure of how to do this, please contact your hosting provider or server administrator.
Error Message "Field xxx doesn't have a default value" during installation
This error occurs when you try to install WHMCS with MySQL Strict Mode enabled. WHMCS requires strict mode to be disabled.
Gateway Errors
Blank Payment Gateway Page
This is usually caused by a double copy of a gateway file in the modules/gateway directory or .htaccess/php.ini or other file not provided with WHMCS in the directory that needs to be removed.
Merchant Gateway Declining or Failing
Take a look in Billing > Gateway Log to see exactly what response your payment gateway is returning and that should indicate what the problem is for you.
User Redirected to Wrong Page on Checkout
If you have customised your WHMCS header template and added or removed a form, you will need to update the forwardpage.tpl template file which by default will submit form 0 or 1 on the page - if you add a form to your header need to add 1 to the forms[x] setting in that file, if you remove one, you need to subtract 1
Invalid Access Attempt
To avoid this error, please ensure you are logging into your admin area using the exact URL defined in Setup > General Settings.
If for example your WHMCS System URL is set to http://www.example.com/whmcs/, you would need to login to your admin area at http://www.example.com/whmcs/admin. If you login at http://example.com/whmcs/admin this can cause the Invalid Access Attempt message (note the www. was omitted).
Server Errors
Hosting accounts aren't provisioned automatically
Please review Utilities > Activity Log at the time of account creation for any error messages, the most common errors are explained further down this page and on Server Modules.
Internal 500 Server Error
An internal server error can be a lot of things but it's always a server issue - not WHMCS. It could be that ioncube is incorrectly installed or there are some settings in a .htaccess file causing an error. Here are a few broad areas for you to check in order to resolve the issue:
An error in one of the PHP Files - Try enabling the display errors option.
File Permissions & Ownership - All files should have a permission level of 644, folders should be 755.
PHP Memory & Process limitations - Try increasing to 128MB
PHP Process Limitations - Check with server admin/hosting provider
Corrupt PHP Modules, Extensions, Builds - Check with server admin/hosting provider
The obscure - If points 1-5 don't produce a fix typically the best course of action is to check the Apache Error Logs.
If the error is not displayed when following point 1, the error is beyond the control of the WHMCS Installation & staff as it becomes a Server issue, which we would not have the level of access to completely resolve.
Examining the Apache Error logs is the next step in trouble shooting, which depending on your level of access, may require contacting your Hosting Provider to assist.
Server Command Error - Curl Error - Couldn't resolve host (6)
This error message indicates that you don't have a server selected for the account to be setup on. There are a few points you should check:
Ensure you have a default server set in Setup > Products/Services > Servers (denoted by an asterisk *) and that a server is selected on the account that you are trying to setup.
If a server group has been configured ensure at-least one server has been added to the group.
The module selected under Setup > Products/Services > Servers is the same as the module selected under Setup > Products/Services > Products/Services > Edit > Module Settings tab.
Server Command Error - Curl Error - Couldn't connect to host (7)
Getting this error means that you have a firewall on your server blocking the connection. The port being used depends upon the module in use but for cPanel it would be 2086/2087, Plesk 8443, DirectAdmin 2222, etc... open for inbound and outbound connections on both the server WHMCS is installed on and the remote server being connected to. Please contact your server admin/hosting provider to open those ports.
Other Module Command/Registrar Error
Steps for identifying the cause of other Module Command or Registrar Command errors can be found in our Troubleshooting Guide.
Allowed memory size of xxxxx bytes exhausted
An error message along the lines of "Allowed memory size of xxxxx bytes exhausted (tried to allocate xxxx bytes)" means that WHMCS has reached maximum amount of memory available per the memory_limit setting in your server's PHP configuration. You should increase this setting until the error is resolved - contact your server admin/hosting provider for assistance making this change. Please take this opportunity to ensure all the other System Requirements are met.
Server load, uptime and phpinfo always say Unavailable or 00:00:00
In order for these values to be obtained, the file /status/index.php that you upload to every server has to be able to execute the PHP functions exec and shell_exec on that server. These are often disabled by default for security reasons. To enable them, you need to login to your server by SSH and then locate the php.ini file and open it for editing. Search down for the line that says disabled_functions and then remove exec and shell_exec from the list of functions following that.
For security, by default the phpinfo is disabled, you would need to edit the index.php file of the status directory and uncomment the phpinfo(); line,
Support Center
Access Denied - You are not assigned to any ticket departments
You have to configure the support ticket departments which you are a member of in Configuration > Administrators. When editing an admin you can choose just some or all of the departments that the admin should be taking care of. They will then only receive notifications about tickets in their departments.
Uploading Attachments
If your support ticket uploads fail to work, it could be because of an incorrectly setup list of allowed file attachment types in Configuration > General Settings > Support. The types must be separated by commas without any spaces, eg. .gif,.jpg,.pdf
Ticket ID not found
You cannot open new tickets via email as an admin, the system expects you to be replying to an existing ticket. Therefore when the email does not contain an existing ticket number you will see this error in the email import log.
Department Not Found
This usually occurs when an email was sent and your support department was added as a CC or BCC. Only emails where the department address is in the To field will a ticket be accepted.
System Errors
Error: domain.com has sent an incorrect or unexpected message. Error Code: -12263
This error means you have an invalid url entered for the System URL(s) in the General Config. For the built in SSL switcher of WHMCS to work, the System URL must be a non-SSL URL and the System SSL URL must be an SSL url. Alternatively, if not using the SSL switcher, you should just enter an URL in the System URL field (either non-SSL or SSL). You should never put the same URL into both fields. This message can also show as: "The page isn't redirecting properly"
There was an error in your request
When checking a domain availability this indicates that your firewall is blocking the whois port; 43. Please ensure port 43 is open. It could also indicate your server is unable to connect to the whois server listed in the /includes/whoisservers.php file - ensure your server is able to connect to the whois server on port 43 for the TLD listed in this file.
There was a problem connecting to the domain registry
When checking a domain availability this indicates that your firewall is blocking the whois port; 43. Please ensure port 43 is open. It could also indicate your server is unable to connect to the whois server listed in the /includes/whoisservers.php file - ensure your server is able to connect to the whois server on port 43 for the TLD listed in this file.
Invalid TLD/Registration Period Supplied for Domain Registration
This error indicates an order has been placed for a TLD or registration period that hasn't been configured. Please review the following video to resolve the issue: http://www.youtube.com/watch?v=JB_IZAKMYw4&hd=1
An order cannot be created because no products or domain registration items have been selected
Same as above; this error indicates an order has been placed for a TLD or registration period that hasn't been configured. Please review the following video to resolve the issue: http://www.youtube.com/watch?v=JB_IZAKMYw4&hd=1
Your IP xx.xx.xx.xxx has been Banned Reason: 3 Invalid Login Attempts
The admin login ban is set to last 15 minutes by default so you will need to wait and then try logging in again or request a new password.
Admin Email Notification Sending Failed - You must provide at least one mailer is not supported.
At least one Administrator must be setup to receive notification emails, you should change this by enabling Support Tickets Notifications in Setup > Administrators > Edit.
Department Not Found. Exiting
You need to setup at least 1 support department in WHMCS in Setup > Support Departments which is where the affiliate withdrawal requests will go to. Then assign your admin users to the department in Setup > Admins who will be notified when the withdrawal request is made.
TCPDF error: Missing or incorrect image file
This means the logo.jpg file in your images folder is missing, or not a valid jpg file. This is the image used when creating the pdf invoice.
Failed opening required '..//dbconnect.php'
When running the domain synchronisation cron job this error may occur. This won't affect the main automation cron, but this error does mean you need to edit the /crons/config.php file and specify the path to your whmcs directory for the sync script to use.
Template Errors
Blank Pages
Blank pages can be caused by errors in your customisations to modules or templates, missing files or if your server doesn't meet the minimum requirements for WHMCS. To see exactly what the issue is, you need to ensure display_errors are set to On in your servers php.ini file and the error_reporting level set to 6143. Then add the line to your WHMCS configuration.php file and revisit the page:
$display_errors=true;
An error message occurring will be shown if it's a PHP error. Once finished testing, remove the line again from the WHMCS config file.
Client Area doesn't work after installing on a Windows Server
After installing WHMCS onto a Windows server, you may find when visiting the client area you just see a blank page. This is caused because the templates_c folder cannot be written to. You need to ensure that the appropriate IUSR account has read/write permissions on the attachments, downloads and templates_c directories and also the configuration.php file and it would resolve issues such as this.
Support by
Waxspace Team
Learn to use Language Files of WHMCS
WHMCS supports numerous languages, in both in the client and admin areas. To enable this, all text used throughout the system is stored within language files.
Language files are stored in the /lang/ sub-folders of both the client and admin directories.
Default Languages
WHMCS includes 20 client area translations by default. These are:
Arabic, Catalan, Croatian, Czech, Danish, Dutch, English, Farsi, French, German, Hungarian, Italian, Norwegian, Brazilian & Native Portuguese, Russian, Spanish, Swedish, Turkish & Ukranian
And for the admin area there are 6 translations included:
Czech, English, French, Portuguese, Russian & Spanish
We rely on the dedication and generosity of our users for contributing translations, as we find real life translations are a much higher quality compared with using automated translation systems as some softwares do. So if you have any suggestions for improvements, or a new language file you are willing to contribute, please get in touch.
Adding a New Language
If a language you operate in is not available as standard, then you can create your own translation. Here's how:
Begin by opening an existing language file
Save this file with a new name - the name you want to be shown in the language selection dropdown menu in WHMCS - the name should only consist of a-z0-9 characters and end with the extension ".php"
Once the file has been created, you can then begin going through and translating the lines within it
An example line is as follows - you should only change the part in bold:
$_LANG['accountinfo'] = "Account Information";
Be careful not to delete any of the quotation marks (") around the text strings or the semi-colons on the ends of each line (;). Also should you want to use a quote character (") within your translated text, you must escape it - for example: \" The language files are written in PHP syntax so valid PHP code must be maintained.
Encoding
By default the language files in WHMCS use the UTF-8 encoding without a Byter Order Marker character at the start. When modifying these files it is important to maintain the same encoding.
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language files will need to be re-saved with ANSI encoding without a Byte Order Marketer. Most text editors have this option (including Notepad).
Overriding Language Strings
The language files are provided unencoded to allow you to view the language strings that WHMCS uses.
However we do not recommend editing these files directly. They are often overwritten during software upgrades to introduce new and updated text.
Instead we recommend that you use overrides which allow you to customise the default variables with your own in a way which can be safely preserved through the upgrade process.
Usage Instructions
Steps for customising language strings via overrides are as follows:
1. Create the folder 'overrides' within the 'lang' folder.
2. Create or copy the language file you want to override. For example, to create an override for the English language you create ./lang/overrides/english.php
3. Open the newly created file in your preferred editor.
4. Start the file with a PHP tag '<?php' indicating PHP code is to be used.
5. Enter the variable(s) you wish to override. For example, if you wanted to change "Welcome to our members area" you would locate the proper variable within ./lang/english.php and place it into the overrides english file with your preferred change:
./lang/english.php
$_LANG['headertext'] = "Welcome to our members area.";
./lang/overrides/english.php
$_LANG['headertext'] = "Welcome home!";
6. For each variable you wish you change, repeat step #5. For example, a completed overrides file should look something like this:
./lang/overrides/english.php
<?php $_LANG['headertext'] = "Welcome home!"; $_LANG['addtocart'] = "Add to Basket"; $_LANG['cartproductaddons'] = "Product Extras";
7. Save, and you're done!
Encoding
By default the language files in WHMCS use the UTF-8 encoding without a Byte Order Marker character at the start. When creating language override files it is important to maintain the same encoding.
If you have chosen to change the system charset setting to something other than UTF-8 (eg. iso-8859-1) then the language override files will need to be re-saved with ANSI encoding without a Byte Order Marketer. Most text editors have this option (including Notepad).
Support by
Waxspace Te4am
Learn to customize PDF invoice in WHMCS
There are 2 invoice templates - one for the client area invoice and another for the PDF version of an invoice. These have the filenamesviewinvoice.tpl and invoicepdf.tpl respectively and can be found in your active WHMCS template folder.
Modifying The Logo
The logo displayed on the PDF invoices is located in the images folder. To change this to your own logo simply upload your logo to the images folder and name it "logo.jpg" or "logo.png"
You can change the width of the logo image in the invoicepdf.tpl template file. On line 4, just adjust the last number "75" before the closing bracket ); on that line, this variable defines the image width. You can then experiment increasing and decreasing it until happy.
Editing Text & Content
You can fully customize the PDF invoices such as adding or removing text, altering the layout or adding furthur images & formatting. This is done by editing the template file invoicepdf.tpl in your active template folder. The file contains all the code relating to the layout and display of the invoice in its PDF format. You will need a basic working knowledge of PHP coding in order to understand and modify the file.
The PDF's are generated using TCPDF & you can find a full list of available functions to help you build your template @ http://www.tcpdf.org/doc/code/classTCPDF.html
Displaying Custom Fields
Custom fields can be displayed on the printable and PDF invoices by ticking the Setup > Custom Client Fields > Show on Invoice option.
Available Variables
The following variables are available for use in the invoicepdf.tpl file and further data can be obtained by running SQL queries directly from within the template which does allow custom PHP code to be executed.
$datecreated - The date the invoice was created
$duedate - The date the invoice is due
$datepaid - Shows paid date/time if invoice is set to Paid
$userid - Client ID Number
$clientsdetails["firstname"] - Client Info First Name
$clientsdetails["lastname"] - Client Info Last Name
$clientsdetails["companyname"] - Client Info Company Name
$clientsdetails["fieldname"] - etc...
$clientsdetails["customfields1"] - Client Info Custom Field #1
$subtotal
$tax
$taxrate
$credit
$total
$status - Paid, Unpaid or Cancelled
$paymentmethod
$notes
$companyname - Your Company Name
$companyurl - Your Default Website URL
$companyaddress - Your Company Address
$invoiceitems - Array of invoice items
Changing/Translating Filename
As standard the filename for invoices is Invoice-xxx and for quotes Quote-xxx where xxx is the ID of the invoice or quote. It may be desirable to change the filenames your clients see or translate into other languages. This is achieved in the same way as any text within WHMCS, through the Language Files, specifically the strings:
$_LANG['invoicefilename'] = "Invoice-"; $_LANG['quotefilename'] = "Quote-";
Reducing the Filesize of PDFs
The bulk of the file size of the PDFs that are generated by WHMCS come from the embedding of the font files for the UTF-8 character set. Because the UTF-8 charset has a large range of characters it supports, this means it takes up much more space than say the iso-8859-1 charset which unlike UTF-8, only supports A-Z 0-9 and other standard characters.
Therefore if you don't need all those special characters UTF-8 supports (ie. you don't have clients using those characters in their names/addresses) then you can reduce the filesize of PDF's quite considerably by changing the font. To do that, simply go to Setup > General Settings > Invoices > TCPDF Font and change the selection from "Freesans" to "Helvetica"
Additional Fonts
If you use certain special characters, they may not be covered by the standard font and so here is an alternative font type that supports Czech, Russian, Arabic & persian among others. To install simply download the font files from the URL below, upload into the /includes/fonts/ folder (v5.3.1 and below) or the/includes/classes/TCPDF/fonts/ folder (v5.3.2 and later) and then activate and specify the custom font namedejavusans in Setup > General Settings > Invoices > TCPDF Font
http://www.whmcs.com/download/106/dejavusans_tcpdf_font
Troubleshooting
Accented Characters
Due to a limitation in PHP you may find the translations of the "Paid" and "Unpaid" text on the PDF Invoices do not display upper-case accented characters correctly. To resolve this please refer tohttp://forum.whmcs.com/showthread.php?t=45594
Question Marks
Should question marks appear in the PDF invoices and quote files in place or characters (usually non-Latin or accented characters) the first thing to try is setting the font to "Freesans" in Setup > General Settings > Invoicing.
If the problem persists after that please download and install the "dejavusans" font as described above Additional Fonts. This font pack contains many more characters than the standard ones so stands the best chance of working with these characters.
Support by
Waxspace Team
Understand Template Syntax of WHMCS
The basic template syntax can be seen by looking at the templates. Template files simply use regular HTML along with tags for where the WHMCS data is inserted into them. All pages have specific variables which you can use. To view a complete list of variables available on a given page, enter the following tag into the template file:
{debug}
When you next access the page containing that template file in your browser after adding this code, a popup window will appear showing you all the different variables which you can use on the page. Variables can be accessed using the {$variable} syntax.
Common Template Variables Available on All Pages
The following is a list of template variables available for use in all the template files of WHMCS
{$companyname} - Company Name
{$pagetitle} - Current Pages Title
{$template} - Template Name
{$charset} - Current Charset Setting
{$todaysdate} - Formatted Date
{$systemurl} - URL to WHMCS System
{$loggedin} - True if logged in
{$clientsdetails.id} - Currently Logged in Users Details
{$clientsdetails.firstname}
{$clientsdetails.lastname}
Custom Template Variables
Not all variables are available on every page, and if the variable you wish to use isn't there, then you would need to obtain this yourself.
Hooks:EmailPreSend can be used to create your own smarty variables to use on email templates.
Using curly braces for literal statements
If you end up using (for example) JS in your templates in-line (instead of using src="#"), you may not get the results that you'd expect. Your smarty template will fail and you will either receive a blank page or an error page (depending on your configuration). To prevent this from happening, you can execute code by using the {literal} tag.
Example:
{literal} <script type="text/javascript"> function myFunc(args) { alert('Hello, world'); } </script> {/literal}
Everything within the {literal} {/literal} tags will not be parsed (such as the template variables above). However, you would be able to accomplish adding the template variables by using multiple literal statements, such as this:
{literal} <script type="text/javascript"> function myFunc(args) { alert('Hello, {/literal}{$clientsdetails.firstname} {$clientsdetails.lastname}{literal}') } {/literal}
Displaying Text to Logged In Users Only
To display something on the page only if a user is logged in, use the following syntax:
{if $loggedin} User is logged in so display client only information {else} User is not logged in so display this {/if}
Displaying Text if Certain Conditions Are Met
In a similar vein it can be useful to display things only if certain conditions are met. For example you might want to display card scheme logos associated with your different payment gateways, or show information based upon what is displayed on the page. This is done using if commands:
{if $gateway.name eq "PayPal"}We accept PayPal{/if}
Would display the message "We accept PayPal" if that option is available on the checkout page. This can be used for any variable.
Using PHP Code within Templates
With the powerful templating system included in WHMCS, it is possible to execute your own PHP code within the templates. This can be used to include other files, run custom functions, integrate with remote systems, etc... To do this you simply use {php}...{/php} tags around a section of PHP code in place of the normal <?php ?> tags.
One of the most common reasons for using PHP code in the templates is to query the database for additional information. An example of how this can be done is below.
{php} $userid = $this->_tpl_vars['clientsdetails']['userid']; $result = mysql_query("SELECT firstname FROM tblclients WHERE id=$userid"); $data = mysql_fetch_array($result); $firstname = $data["firstname"]; echo $firstname; {/php}
The first line in the above code is also demonstrating how you can retrieve and use template variables within your custom PHP code.
Support by
Waxspace Team