PHP Magento Tips

Restrict Shipping to Only Continental United States in Magento

Rate this posting:
{[['']]}

If you want to disable some specific regions from US country, but you don’t want to delete them, this inchoo’s extension will allow you to chose which ones are possible to use for your customer’s addresses.

You can get it from: https://github.com/tomasinchoo/Inchoo_USDisableRegions

There is one issue in this extension

in app/code/community/Inchoo/USDisableRegions/Model/Adminhtml/System/Config/Source/Region.php at line no. 41

class Inchoo_USDisableRegions_Model_Adminhtml_System_Config_Source_Region {

    public function toOptionArray() {

        $allowedRegions = array();

        foreach(Mage::getModel('directory/region_api')->items("US") as $region) {

            $allowedCountries[] = array('value' => $region["name"], 'label' =>$region["name"]);

        }
        return $allowedRegions;
    }
}

should be

class Inchoo_USDisableRegions_Model_Adminhtml_System_Config_Source_Region {

    public function toOptionArray() {

        $allowedRegions = array();

        foreach(Mage::getModel('directory/region_api')->items("US") as $region) {

            $allowedRegions[] = array('value' => $region["name"], 'label' =>$region["name"]);

        }
        return $allowedRegions;
    }
} 

just install this extension and go to System->Configuration->General->Enabled Regions and chose only those regions you would like to use.


You can find Continental United States list from https://en.wikipedia.org/wiki/Contiguous_United_States#List_of_contiguous_U.S._states
Tag : Magento
1 Comments On "Restrict Shipping to Only Continental United States in Magento"

Hi,

Thank you for sharing useful article

I would like to introduce one of Our web designers and developers will give the best and high quality local USA website Development Services with low cost if you need more details about our web designing services so please feel free to contact us.

Ecommerce Web Development Services in USA

Magento Ecommerce Website Development
Travel portal Development
Web Application Development USA
Yalavarthi Software solutions USA

Back To Top