0

In my registration form I need to add the Country field. I would like to use the built-in countries dropdown of Magento. Via backend it is not possible to add it. How should I add it?

2

You can search in this site or google how to add customer attribute. The specific for you case is that your attribute should be with:

'type'   => 'varchar',
'input'  => 'select',
'source' => 'customer/entity_address_attribute_source_country',
  • that source returns only the allowed countries, I would like to have the entire collection of countries. Which source should I use? – gianis6 Jan 13 '15 at 10:57
  • Please try with catalog/product_attribute_source_countryofmanufacture or make your own copy of Mage_Customer_Model_Entity_Address_Attribute_Source_Country and in public function getAllOptions() remove ->loadByStore($this->getAttribute()->getStoreId()) or replace it with loadData(). – michael Jan 13 '15 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.