Created
August 19, 2012 01:40
-
-
Save deniscsz/3390847 to your computer and use it in GitHub Desktop.
Arquivo que altera o BD
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$installer = $this; | |
$installer->startSetup(); | |
$setup = Mage::getModel('customer/entity_setup', 'core_setup'); | |
$setup->addAttribute('customer', 'tipopessoa', array( | |
'type' => 'int', | |
'input' => 'select', | |
'label' => 'Tipo Pessoa', | |
'global' => 1, | |
'visible' => 1, | |
'required' => 0, | |
'user_defined' => 1, | |
'default' => '0', | |
'visible_on_front' => 1, | |
'source' => 'novoatributo/entity_tipopessoa', | |
)); | |
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) | |
{ | |
Mage::getSingleton('eav/config') | |
->getAttribute('customer', 'tipopessoa') | |
->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit','checkout_register')) | |
->save(); | |
} | |
$tablequote = $this->getTable('sales/quote'); | |
$installer->run(" | |
ALTER TABLE $tablequote ADD `customer_tipopessoa` INT NOT NULL | |
"); | |
$installer->endSetup(); | |
$installer = $this; | |
$installer->startSetup(); | |
$setup = Mage::getModel('customer/entity_setup', 'core_setup'); | |
$setup->addAttribute('customer', 'rg', array( | |
'type' => 'text', | |
'input' => 'text', | |
'label' => 'Identidade (RG)', | |
'global' => 1, | |
'visible' => 1, | |
'required' => 0, | |
'user_defined' => 1, | |
'default' => '0', | |
'visible_on_front' => 1, | |
)); | |
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) | |
{ | |
Mage::getSingleton('eav/config') | |
->getAttribute('customer', 'rg') | |
->setData('used_in_forms', array('adminhtml_customer','customer_account_create','customer_account_edit','checkout_register')) | |
->save(); | |
} | |
$tablequote = $this->getTable('sales/quote'); | |
$installer->run(" | |
ALTER TABLE $tablequote ADD `customer_tipopessoa` INT NOT NULL | |
"); | |
$installer->endSetup(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment