I want to add a new attribute for the customers: continent.
First of all, I have created a new module for this where I'm inserting this new attribute:
<?php
$this->addAttribute('customer', 'continent', array(
'type' => 'int',
'label' => 'Continent',
'input' => 'text',
'position' => 120,
'required' => true,
'is_system' => 0,
));
$attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'continent');
$attribute->setData('is_user_defined', 0);
$attribute->save();
?>
There's nothing to show in the frontend, everything in the backend depending on the chosen country.
And now I want to implement the logic when a new user register or edits his personal info. Something like:
if country = US then continent = 1, if country = UK then continent = 2, and so on...
I want to kepp a static file (XML?) somewhere with the relationships between countries and continents.
<US>1</US>
<UK>2</UK>