Magento 1.9 – Customer Billing and Shipping Address with Abbreviated State Dropdown for USA

billing-addresscheckoutmagento-1.9onepage-checkoutshipping-address

With magento 1.9CE i want to display drop down for states abbreviations instead of full state names on the billing and shipping address on the checkout page

Is there is a quick and easy way i could do this ?

Best Answer

if you want this for all regions not only US, you need to change the method Mage_Directory_Model_Resource_Region_Collection::toOptionArray.

Instead of this:

$options = $this->_toOptionArray('region_id', 'default_name', array('title' => 'default_name'));

you need

$options = $this->_toOptionArray('region_id', 'code', array('title' => 'code'));

If you want it only for US regions, you need to modify the data in the table directory_country_region and directory_country_region_name. You will identify the state names easily.