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
0 Comments On "Restrict Shipping to Only Continental United States in Magento"

Back To Top