jeremyhaber Posted March 17, 2011 Share Posted March 17, 2011 (edited) Hey Guys; I was recently asked if it was possible to make the quotes in WHMCS generate a pdf file using the clients language preference. The simple answer is yes. Add the following to the top of quotepdf.tpl just after <?php if ($clientsdetails["language"]) { unset($_LANG); copy ( ROOTDIR."/lang/".$clientsdetails["language"].".txt", ROOTDIR."/lang/".$clientsdetails["language"].".php"); $current = file_get_contents(ROOTDIR."/lang/".$clientsdetails["language"].".php"); $current = "<?php ".$current; file_put_contents(ROOTDIR."/lang/".$clientsdetails["language"].".php", $current); include ROOTDIR."/lang/".$clientsdetails["language"].".php"; unlink(ROOTDIR."/lang/".$clientsdetails["language"].".php"); } What this does is unsets the current language and reloads the clients language. Now all you have to do is change the static text into language variables Hope this helps! Edited March 17, 2011 by jeremyhaber 0 Quote Link to comment Share on other sites More sharing options...
HostRW Posted March 18, 2011 Share Posted March 18, 2011 Thank you Jeremy!! This is extremely helpful,and it works really well. Has anyone noticed that the email being sent out with the quotes does ignore the set language? It is not working with me. No matter what language I have set, it is just sending out the default language wihich is of course really annoying. I tried using: {if $language == "French"} french version {elseif $language == "English"} english version {else} default language version {/if} But it deletes the first entry and then shows {else} and {/if} as plain text. Not sure why Matt has not fixed this yet. But if anyone has a solution I would really apreciate it. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.