Search This Blog

Friday 13 July 2012

Magento: Display countries dropdown in custom module add / edit screen

Add below piece of code to the form page in customer module admin section

$countries = Mage::getResourceModel('directory/country_collection')->loadData()->toOptionArray(false);
$fieldset->addField('country', 'select', array(
          'label'     => Mage::helper('core')->__('Country'),
          'name'      => 'country',
          'values'    => $countries,
  ));

Here 'country' is field name from your custom module


You are done!!!

No comments:

Post a Comment