The article was written in 2010 (with a maximum of Magento 1.5), and things have changed a little since then. Particularly, the file that this article said to copy/edit is now deprecated. The new file has much code that is different.
You need to copy app/code/core/Mage/Directory/Model/Resource/Region/Collection.php
. When you open it up, jump down to line 75 and add:
$excludeRegions = array ('AS','AK','AA','AC','AE','AK','AM','AP','FM','GU','HI','MH','MP','PW','PR','VI','AF');
$this->getSelect()->where('code NOT IN (?)', $excludeRegions);
This will do the trick. I would suggest that you do not copy files, and instead write a module override/rewrite this class, so you can just use this function:
protected function _initSelect()
{
parent::_initSelect();
$excludeRegions = array ('AS','AK','AA','AC','AE','AK','AM','AP','FM','GU','HI','MH','MP','PW','PR','VI','AF');
$this->getSelect()->where('code NOT IN (?)', $excludeRegions);
return $this;
}
With this, Magento can change their core code on the page, and you are just doing one little tiny thing and not affecting anything else.
Best Answer
This can be easily achievable without removing from "directory_country_region" database table.
Just you need to follow below steps:
So the final code looks like as below:
Hoping this will help to someone.
Thanks,