The domain prices table on the Register Domain and Transfer Domain pages pulls your domain pricing directly from your WHMCS (WHMCS admin > domain pricing) and will update dynamically. This is achieved by using WHMCS datafeeds:
This is great as it means that you do not need to update the domain pages within the template.
Slow domain page speed?
The only negative of using data feeds to pull the domain pricing is speed. If you have a lot of domains setup in WHMCS it will have a big impact on how long it takes for the domain page to load. If this becomes a problem there is a solution, that is replacing the dynamic table with a static HTML copy. This table will look exactly the same but is not dynamic so there's no calls to the database.
Before we start it's important to note that both the Register Domain and Transfer Domain pages use the same table.
To replace the dynamic table visit the front-end of your Register Domain page (http://yourdomain.com/registerdomain.php), right click somewhere on the page and then click on view source.
Search for the link that ends in domainpricing.php and click it.
You will then see code in the following format (with your TLDs):
Save this code to Notepad or your code editor to keep it safe.
Open the following file:
Find the following code:
And replace with:
That edit will comment the dynamic table so it's no longer used.
Next you will need to copy the earlier code from <table> to </table>, paste this code below the line you commented out above.
The finished result will look like:
Repeat these same edits for the Transfer Domain page (/templates/your_template/registerdomain.tpl).
Your domain pages will now load very quickly regardless of how many domains you have setup.
Need updated pricing?
If you have made changes to your domains and pricing instead of manually editing the HTML you can quickly and easily grab the new code. To do this un-comment the dyanmic table by changing:to:
View the page source again and copy the new HTML and paste in replacement of the old. Lastly comment out the above line again.
Your domains table should now match your domains and pricing as set in WHMCS.
Leave a comment
Let us know what you think!