VirtueMart language text string changes

Quite often while building eCommerce sites using VirtueMart, I’ve found it necessary to change text strings located in the core section of VirtueMart.

For Example  in administrator/com_virtuemart/languages/common/english.php

This has always been a concern to me, as I’d prefer to limit all changes to one defined area i.e. the specific VirtueMart theme that I’m working on, as it makes updating the “live” site easier, and limits the possibility of introducing bugs which could occur by “patching” the core files.

My solution to this problem is to put language text string changes into the constructor of the theme.php

i.e. in theme.

in function vmTheme() {  insert the line

global $VM_LANG;
Then insert lines for each text string that needs to be changed. For example.

$VM_LANG->modules[‘shop’][‘PHPSHOP_WAITING_LIST_MESSAGE’]=’Sorry, this product is not available!’;

So the constructor now looks like this

function vmTheme() {
global $VM_LANG;
$VM_LANG->modules['shop']['PHPSHOP_WAITING_LIST_MESSAGE']='Sorry, this product is not available!';

Note. At the time of writing, the current version of VM is 1.1.4 . This method may not work with versions other than 1.1.4