Ecommerce State/Province wording

Permalink 2 users found helpful
I have asked this question before and was given a list of files that has State/Province hardcoded into them. I changed State/Province in elements>order>detail.php as that was the only file that looked like it related to the checkout form but it doesn't have any effect on the form. I just want to change State/Province to County as we are in the UK. Could someone give me a clue on where to change this.


View Replies:
JohntheFish replied on at Permalink Reply
Here is a list of where the text State/Province is hard coded into eCommerce:

elements\orders\detail.php(38): <tr><td><label><?php echo t('State/Province')?>:</label></td><td><?php echo $billing->getStateProvince()?></td></tr>
elements\orders\detail.php(67): <tr><td><label><?php echo  t('State/Province')?>:</label></td><td><?php echo $shipping->getStateProvince()?></td></tr>
elements\orders\export_row_headers.php(35): echo "<td><b>".$prefix. t('State/Province')."</b></td>";
elements\orders\export_row_headers.php(58): echo "<td><b>".$prefix. t('State/Province')."</b></td>";
elements\sales\tax_form_required.php(85): <?php echo $form->label('salesTaxRateStateProvinceSelect', t('State/Province'))?>
elements\sales\tax_form_required.php(87): <?php  echo $form->select('salesTaxRateStateProvinceSelect', array('' => t('Choose State/Province')), $salesTaxRateStateProvince, array('class' => 'span4', 'ccm-attribute-address-field-name' => 'salesTaxRateStateProvince'))?>
mail\order.php(34): $body .= "State/Province: " . $billing['state'] . "\n";
mail\order.php(54): $body .= "State/Province: " . $shipping['state'] . "\n";
mail\receipt.php(35): $body .= "State/Province: " . $billing['state'] . "\n";
mail\receipt.php(55): $body .= "State/Province: " . $shipping['state'] . "\n";

You will probably need to change all of the elements, and will probably want to change the mail\receipt.
nickodalton replied on at Permalink Reply
thanks for the answer John,

Would you have to change the core files in the core-commerce/elements/ directory as you cannot overwrite them in root/elements according to the documentation?

JohntheFish replied on at Permalink Reply
I have never done it, but I think you can override some eCommerce files - libraries, models, controllers and single pages. You can't override elements directly. However, you can use an override of one of the above to indirectly override an element. See

As an aside, I have Country State Manager in the PRB at the moment. It doesn't solve your title problem, but does provide an easy way to edit and manage the lists. (The following link won't work for most users until approved)
nickodalton replied on at Permalink Reply
Seems to be quite a decent UK following for C5, I think this should be easier to change do you not think? i.e to county/state.

I'll keep an eye out for your add-on, the link is not working yet

JohntheFish replied on at Permalink Reply
Another thought, maybe an easier but hacky solution is to screen-scrape this in the browser, by adding some jQuery to look for 'State/Province' and change it to 'County'.

There are a few situations where I have done similar using jQuickie.
or by coding an attribute to add the relevant script.