_shippingCountries)) { $store_id = Mage_Core_Model_App::ADMIN_STORE_ID; if (strlen($code = Mage::getSingleton('adminhtml/config_data')->getStore())) { $store_id = Mage::getModel('core/store')->load($code)->getId(); } elseif (strlen($code = Mage::getSingleton('adminhtml/config_data')->getWebsite())) { $website_id = Mage::getModel('core/website')->load($code)->getId(); $store_id = Mage::app()->getWebsite($website_id)->getDefaultStore()->getId(); } $this->_shippingCountries = Mage::getModel('directory/country')->getResourceCollection()->loadByStore($store_id)->toOptionArray(true); } return $this->_shippingCountries; } public function setInputName($value) { return $this->setName($value); } public function _toHtml() { $this->_getShippingCountries(); if (!$this->getOptions()) { foreach ($this->_getShippingCountries() as $key => $value) { if(isset($value['value']) && $value['value'] && isset($value['label']) && $value['label']) $this->addOption($value['value'], $value['label']); } } return parent::_toHtml(); } }