Invoice Displays Incorrect State Abbreviation

By | January 22, 2013

As stated in the bug report, state abbreviation displays the first two letters of the State and not the abbreviation assigned within the customer acknowledgment email. For example, Texas is listed as TE and not TX.  The first to letters are used, instead..

To fix this bug, locate the PDF.php file located here: classes/PDF.php

Line 436: add a blank line after {

Line 461: remove the following code:

$state = &$addressType[$type][‘addressFormatedValues’][$pattern];
$state = strtoupper(substr($state, 0, 2));

.. and replace with the following code:

$state_name = &$addressType[$type][‘addressFormatedValues’][$pattern];
$state = new State((int)State::getIdByName($state_name));
if (Validate::isLoadedObject($state))
$state_name = $state->iso_code;
$state_name = strtoupper(substr($state_name, 0, 2));

You can view the Bug Fix Here on the


Bug Tracker, US states abbreviations on invoices are incorrect: -US7
PDF Bug Fixed: #PSCFI-3254 – US States Abbreviations are incorrect: