"We needed technical guidance and support and thanks to the team at Three Rock we now have streamlined processes and can manage the project with ease." Steve Sherlock: Managing Director 'Oodles' car hire comparison web site |
| Virtuemart States for Australia |
|
Modifying an out of the box installation of Virtuemart for the Australian market where addresses have a two and three character state code ie QLD, NSW, TAS, WA, SA, NT etc. This is a fairly simple fix and works a treat for Virtuemart 1.14 Three simple changes require. One change each for the following two file components/com_virtuemart/themes/default/templates/checkout/list_shipto_addresses.tpl.php components/com_virtuemart/themes/default/templates/checkout/customer_info.tpl.php In each file search for the first occurrance of the word 'state'. You will find the default is using state_2_code In each file, change it to state_3_code The next file to update is administrator/components/com_virtuemart/classes/ps_html.php Again, all occurrances of state_2_code need to be changed to state_3_code Another little fix I used is where no City value is entered, an ugly looking comma is displayed. To stop this, come a few lines above the state change you've just made. Find the line that has the text echo $db->f("city");Underneath it you'll find the culprit, a line that just blindly outputs a comma echo ', '; Just above the comma culprit place the following 'if' condition. if($db->f("city") != "")so your code should look like this: if($db->f("city") != "") The address section of the file now looks something like the following <td nowrap="nowrap" width="10%" align="right"><?php echo $VM_LANG->_('PHPSHOP_ADDRESS') ?>: </td>Now you've updated the code, your 3 letter states will be listed with three letters. But hang on!! What about NT, SA and WA? Unfortunately they get changed to NOT SOA and WEA. Not what we want. To fix this, log into your Virtuemart site as an administrator. Select the 'Admin' menu option, then List Countries. Click the '[List States]' suboption against the country name. n here you can enter the correct values for the 3 character value for each state. |