Skip to content

Instantly share code, notes, and snippets.

@zandzpider
Created June 25, 2014 15:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zandzpider/c79c2e88707a991b481a to your computer and use it in GitHub Desktop.
Save zandzpider/c79c2e88707a991b481a to your computer and use it in GitHub Desktop.
<?php
$installer = $this;
$installer->startSetup();
for ($i = 2015; $i <= 2020; $i++)
{
$setup = Mage::getModel('customer/entity_setup', 'core_setup');
$setup->addAttribute('customer', "kid_$i", array(
'type' => 'int',
'input' => 'text',
'label' => "KID $i",
'global' => 1,
'backend' => '',
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'default' => '0',
'visible_on_front' => 1,
));
Mage::getSingleton('eav/config')
->getAttribute('customer', "kid_$i")
->setData('used_in_forms', array('adminhtml_customer'))
->save();
}
$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment