If you manage different languages for your WHMCS site, it may happen that the same "static" page for different languages is quite different - both in contents, both in pagination.

I.e: the "About Us" page may be completely different, because the English version will be directed to the international market, while the Italian version will be specific for Italian market (also with images and media referred to Italy), the Spanish for the Spanish market, and so on...

In this case, instead of using WHMCS language variables, you can set up in WHMCS completely different pages, with different names, and then redirect the user from one to the other evaluating the language set in WHMCS.

To do so:

  • create two different .php files (i.e. mypage.php and myitalianpage.php), and two correspondings.tpl files (i.e. mypage.tpl and myitalianpage.tpl)  

  • in the "international" page mypage.php, just after the   $ca = new WHMCS_ClientArea();   statement, insert following code:
       

$language=Lang::trans('locale');

if ($language == 'it_IT') {

  header("location: myitalianpage.php");

}

  • while in the Italian page myitalianpage.php you'll need to add following code:

$language=Lang::trans('locale');

if ($language != 'it_IT') {

  header("location: mypage.php");

}

 

 

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • WHMCS
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 How to add a favicon in WHMCS

To add a favicon to your WHMCS install: copy your favicon (es. myfavicon.ico) in WHMCS folder...

 How to comment in template (.tpl) files

If you need to insert a comment in a .tpl file, or comment a block of code to disable it, you...

 How to insert a Youtube video in WHMCS knowledgebase article

To insert a YouTube video in an article of the WHMCS knowledge base, you need to insert following...

 How to disable a customer to pay invoices partly with credit balance

in WHMCS if a customer has not enough credit balance for full payment of an invoice, WHMCS allows...

 How to add a cookie bar to WHMCS

In order to add a cookie bar to your own installation of WHMCS: copy somewhere on your WHMCS...