Jump to content

No overrides directory in whmcs_5.2.13_full.zip


epretorious

Recommended Posts

The documentation for WHMCS is very thin in many places and the whole Language files article is especially sparse!

 

As I understand it you have to create the overrides folder if you want one. I don’t recall it being in the standard install.

 

Overrides

For those who don’t know about the overrides (I didn’t until recently) and how useful it is let me explain;

 

WHMCS do not recommend editing the core language files directly. It’s easy to forget about changes and overwrite them during software upgrades when the core file introduces new or updated text.

 

What they recommend is that you use ‘overrides’ which allow you to ‘override’ the default language variables with your own in a way which then takes precedence over the core variables.

This is important as the custom 'override' file can be retained through the upgrade process.

 

It’s quite easy in that all you do if you want to override a particular variable is to create a file with the same name as the language you are using in a sub-folder of /lang/ called ‘overrides’. Remember you may have to create that folder if it does not exist.

For example, to create an override for the English language file you create /lang/overrides/english.php

 

The actual file is simply a php text file (so starts with <?php tag). Here is an example that overides the three variables headertext, cartdomain and cartproduct.

 

<?php
$_LANG['headertext'] = "Hello World <br> it’s a lovely day to buy from us!";
$_LANG['cartdomain'] = "Domain name <strong>now</strong> in your cart!";
$_LANG['cartproduct'] = "<h2>You are buying the following product</h2>";

 

Tip: What is not mentioned is that you can use tags in the text (as can be seen from the example).

This means you can emphasise and format the output which makes it a lot easier to convey important messages.

Its amazing WHMCS keep this facility a secret.

 

Trevor

Link to comment
Share on other sites

This is in the documentation:

 

http://docs.whmcs.com/Language_Files

 

- - - Updated - - -

 

Tip: What is not mentioned is that you can use tags in the text (as can be seen from the example).

This means you can emphasise and format the output which makes it a lot easier to convey important messages.

Its amazing WHMCS keep this facility a secret.

 

Trevor

 

You can do that, but I like to put my HTML in the templates, and not in the language files. This keeps things consistent. That way, you know where all the HTML and CSS stuff is (in one place). When you change your layout, you don't have to edit all the HTML tags you put in the language files.

Link to comment
Share on other sites

I am very much with you on the html aspect in templates though in this case we are talking about language files which have a specific wider role in WHMCS.

 

Very often the same variable is re-used in many differing areas and updating the template for each of those pages looks to me more time consuming that simply adding a formatting code to the language file variable.

 

As a matter of interest, can you give a quick example to demonstrate how you would emphasize a portion of a variable text like the following in the language override file?

 

<?php
$_LANG['headertext'] = "Hello World <strong> it’s a lovely day to buy from us!</strong>";

 

I suppose you could create two variables and then concatenate them in your template, but then you would have to ensure that it is replicated in all the templates that use the variable. And then that makes the whole overrides facility redundant.

 

 

Trevor

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated