protected function _getAttributeColumnDefinition($code, $data) { $definition = parent::_getAttributeColumnDefinition($code, $data); if ($code === 'bronto_imported' && is_string($definition)) { return 'datetime NULL DEFAULT NULL'; } return $definition; }
<?php // $installer = $this; //Mage_Core_Model_Resource_Setup $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); /** * Create table 'adm_abandonedcart/followup' */ $table = $installer->getConnection()->newTable($installer->getTable('adm_abandonedcart/followup'))->addColumn('followup_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), 'Followup Id')->addColumn('quote_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Quote Id')->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Store Id')->addColumn('abandonned_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array('nullable' => false), 'Cart Abandoned At')->addColumn('customer_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'default' => '0'), 'Customer Id')->addColumn('customer_email', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(), 'Customer Email')->addColumn('base_grand_total', Varien_Db_Ddl_Table::TYPE_DECIMAL, '12,4', array('default' => '0.0000'), 'Base Grand Total')->addColumn('coupon_code', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(), 'Coupon Code')->addColumn('secret_code', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(), 'Secret code')->addColumn('is_closed', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'default' => '0'), 'Is restored')->addColumn('offset', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'default' => '0'), 'Offset')->addColumn('mail_scheduled_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array('nullable' => false), 'Mail1 Scheduled At')->addIndex($installer->getIdxName('adm_abandonedcart/followup', array('customer_id', 'store_id')), array('customer_id', 'store_id'))->addIndex($installer->getIdxName('adm_abandonedcart/followup', array('store_id')), array('store_id'))->addForeignKey($installer->getFkName('adm_abandonedcart/followup', 'store_id', 'core/store', 'store_id'), 'store_id', $installer->getTable('core/store'), 'store_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)->addIndex($installer->getIdxName('adm_abandonedcart/followup', array('quote_id')), array('quote_id'))->addForeignKey($installer->getFkName('adm_abandonedcart/followup', 'quote_id', 'sales/quote', 'entity_id'), 'quote_id', $installer->getTable('sales/quote'), 'entity_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)->setComment('ADM Cart Abandoned to follow'); $installer->getConnection()->createTable($table); $table = $installer->getConnection()->newTable($installer->getTable('adm_abandonedcart/tracker'))->addColumn('tracker_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true), 'Tracker Id')->addColumn('followup_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Followup Id')->addColumn('store_id', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'nullable' => false, 'default' => '0'), 'Store Id')->addColumn('restored', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'default' => '0'), 'Restored')->addColumn('offset', Varien_Db_Ddl_Table::TYPE_SMALLINT, null, array('unsigned' => true, 'default' => '0'), 'Offset')->addColumn('track_code', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(), 'Message')->addColumn('track_message', Varien_Db_Ddl_Table::TYPE_TEXT, 255, array(), 'Message')->addColumn('remote_ip', Varien_Db_Ddl_Table::TYPE_TEXT, 16, array('nullable' => false), 'Customer IP')->addColumn('created_at', Varien_Db_Ddl_Table::TYPE_TIMESTAMP, null, array('nullable' => false), 'Created At')->addForeignKey($installer->getFkName('adm_abandonedcart/tracker', 'followup_id', 'adm_abandonedcart/tracker', 'followup_id'), 'followup_id', $installer->getTable('adm_abandonedcart/followup'), 'followup_id', Varien_Db_Ddl_Table::ACTION_CASCADE, Varien_Db_Ddl_Table::ACTION_CASCADE)->setComment('ADM Cart Abandoned tracker'); $installer->getConnection()->createTable($table); $installer->endSetup();
<?php /** * J2T RewardsPoint2 * * NOTICE OF LICENSE * * This source file is subject to the Open Software License (OSL 3.0) * that is available through the world-wide-web at this URL: * http://opensource.org/licenses/osl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to license@j2t-design.com so we can send you a copy immediately. * * @category Magento extension * @package RewardsPoint2 * @copyright Copyright (c) 2009 J2T DESIGN. (http://www.j2t-design.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); $installer->addAttribute('customer', 'rewardpoints_accumulated', array('type' => 'int', 'label' => 'Accumulated Points', 'visible' => false, 'required' => false)); $installer->addAttribute('customer', 'rewardpoints_available', array('type' => 'int', 'label' => 'Available Points', 'visible' => false, 'required' => false)); $installer->addAttribute('customer', 'rewardpoints_spent', array('type' => 'int', 'label' => 'Spent Points', 'visible' => false, 'required' => false)); $installer->addAttribute('customer', 'rewardpoints_lost', array('type' => 'int', 'label' => 'Lost Points', 'visible' => false, 'required' => false)); $installer->addAttribute('customer', 'rewardpoints_waiting', array('type' => 'int', 'label' => 'Waiting Points', 'visible' => false, 'required' => false)); $installer->endSetup();
<?php require_once 'app/Mage.php'; Mage::app(); $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); $vCustomerEntityType = $installer->getEntityTypeId('customer'); $vCustAttributeSetId = $installer->getDefaultAttributeSetId($vCustomerEntityType); $vCustAttributeGroupId = $installer->getDefaultAttributeGroupId($vCustomerEntityType, $vCustAttributeSetId); $installer->addAttribute('customer', 'ziscorporate', array('label' => 'Customer Type', 'input' => 'select', 'type' => 'int', 'global' => 1, 'visible' => 1, 'visible_on_front' => 1, 'forms' => array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'), 'source' => 'eav/entity_attribute_source_table', 'option' => array('values' => array(0 => 'Consumer', 1 => 'Corporate')), 'required' => 0, 'user_defined' => 0, 'position' => 20)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'ziscorporate', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'ziscorporate'); $oAttribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register')); $oAttribute->save(); /* add corporate name */ $installer->addAttribute('customer', 'zcorporatename', array('label' => 'Corporate Name', 'input' => 'text', 'type' => 'varchar', 'global' => 1, 'visible' => 1, 'visible_on_front' => 1, 'forms' => array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'), 'required' => 0, 'user_defined' => 0, 'position' => 21)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'zcorporatename', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'zcorporatename'); $oAttribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register')); $oAttribute->save(); /* is approver */ $installer->addAttribute('customer', 'zcorporateapprover', array('label' => 'Corporate Approver', 'input' => 'select', 'type' => 'varchar', 'global' => 1, 'visible' => 1, 'visible_on_front' => 1, 'forms' => array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'), 'source' => 'eav/entity_attribute_source_boolean', 'required' => 0, 'user_defined' => 0, 'position' => 22)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'zcorporateapprover', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'zcorporateapprover'); $oAttribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register')); $oAttribute->save(); /* approver id - if not approver*/ $installer->addAttribute('customer', 'zmyapprover', array('label' => 'This Users Approver', 'input' => 'text', 'type' => 'int', 'global' => 1, 'visible' => 1, 'visible_on_front' => 1, 'forms' => array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'), 'required' => 0, 'user_defined' => 0, 'position' => 23)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'zmyapprover', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'zmyapprover'); $oAttribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'));
<?php $installer = $this; $installer->startSetup(); $installer->run("\r\n\r\nDROP TABLE IF EXISTS {$this->getTable('luckydraw_code')};\r\nDROP TABLE IF EXISTS {$this->getTable('luckydraw_program')};\r\n\r\nCREATE TABLE {$this->getTable('luckydraw_program')} (\r\n `program_id` int(10) unsigned NOT NULL auto_increment,\r\n `name` varchar(255) NOT NULL default '',\r\n `short_description` text NULL,\r\n `award_image` varchar(255) NULL,\r\n `description` mediumtext NULL,\r\n `url_key` varchar(255) NULL,\r\n `status` smallint(5) default '0',\r\n `created_time` datetime NULL,\r\n `start_time` datetime NULL,\r\n `end_time` datetime NULL,\r\n `code_length` smallint(5) default '5',\r\n `min_user` smallint(5) default '0',\r\n `auto_prize` tinyint(1) default '0',\r\n `prize_code` varchar(255) default '',\r\n `prize_days` int(10) default '0',\r\n `credit_rate` decimal(12,4) NOT NULL default '0',\r\n `term_condition` mediumtext NULL,\r\n `store_ids` text NULL,\r\n PRIMARY KEY (`program_id`)\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\nCREATE TABLE {$this->getTable('luckydraw_code')} (\r\n `code_id` int(10) unsigned NOT NULL auto_increment,\r\n `program_id` int(10) unsigned NOT NULL,\r\n `customer_id` int(10) unsigned NOT NULL,\r\n `refer_user` int(10) unsigned NOT NULL,\r\n `refer_email` varchar(255) NULL,\r\n `name` varchar(255) NULL,\r\n `email` varchar(255) NULL,\r\n `address_id` int(10) unsigned NULL,\r\n `order_id` int(10) unsigned NOT NULL,\r\n `order_increment_id` varchar(127) NULL,\r\n `draw_code` varchar(255) NULL,\r\n `created_time` datetime NULL,\r\n `expired_time` datetime NULL,\r\n `status` smallint(5) default '0',\r\n `is_prize` tinyint(1) default '0',\r\n `credit_rate` decimal(12,4) NOT NULL default '0',\r\n PRIMARY KEY (`code_id`),\r\n INDEX (`program_id`),\r\n FOREIGN KEY (`program_id`)\r\n REFERENCES {$this->getTable('luckydraw_program')} (`program_id`)\r\n ON DELETE CASCADE\r\n ON UPDATE CASCADE\r\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n "); try { $installer->run("\r\n\tALTER TABLE {$this->getTable('sales/order')}\r\n\t\tADD COLUMN `luckydraw_discount` decimal(12,4) default NULL,\r\n\t\tADD COLUMN `base_luckydraw_discount` decimal(12,4) default NULL;\r\n\t"); } catch (Exception $e) { } try { $setup = new Mage_Customer_Model_Entity_Setup(); $setup->addAttribute('customer', 'national_id', array('group' => 'General', 'type' => 'varchar', 'input' => 'text', 'label' => 'National Identification', 'visible' => 1, 'required' => 0, 'visible_on_front' => 1, 'sort_order' => 120)); $setup->getConnection()->insertMultiple($setup->getTable('customer/form_attribute'), array(array('form_code' => 'adminhtml_customer', 'attribute_id' => $setup->getAttributeId('customer', 'national_id')))); } catch (Exception $e) { } $installer->endSetup();
<?php require_once '../../../../Mage.php'; Mage::app(); $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); // Add gemgento_id to products $attrCode = 'gemgento_id'; $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup'); $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCode); if ($attrIdTest === false) { $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, array('group' => 'General', 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'backend' => '', 'frontend' => '', 'label' => 'Gemgento Id', 'note' => 'The product id in Gemgento', 'input' => 'text', 'class' => '', 'source' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'visible' => true, 'required' => false, 'user_defined' => true, 'default' => '0', 'visible_on_front' => false, 'unique' => false, 'is_configurable' => false, 'used_for_promo_rules' => false)); } $installer->endSetup();
<?php require_once '../../../../Mage.php'; Mage::app(); $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); // add gemgento_id to customers $vCustomerEntityType = $installer->getEntityTypeId('customer'); $vCustAttributeSetId = $installer->getDefaultAttributeSetId($vCustomerEntityType); $vCustAttributeGroupId = $installer->getDefaultAttributeGroupId($vCustomerEntityType, $vCustAttributeSetId); $installer->addAttribute('customer', 'gemgento_id', array('label' => 'Gemgento Id', 'input' => 'text', 'type' => 'int', 'forms' => array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register'), 'required' => 0, 'user_defined' => 1)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'gemgento_id', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'gemgento_id'); $oAttribute->setData('used_in_forms', array('customer_account_edit', 'customer_account_create', 'adminhtml_customer', 'checkout_register')); $oAttribute->save(); // Add gemgento_id to products $attrCode = 'gemgento_id'; $objCatalogEavSetup = Mage::getResourceModel('catalog/eav_mysql4_setup', 'core_setup'); $attrIdTest = $objCatalogEavSetup->getAttributeId(Mage_Catalog_Model_Product::ENTITY, $attrCode); if ($attrIdTest === false) { $objCatalogEavSetup->addAttribute(Mage_Catalog_Model_Product::ENTITY, $attrCode, array('group' => 'General', 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'backend' => '', 'frontend' => '', 'label' => 'Gemgento Id', 'note' => 'The product id in Gemgento', 'input' => 'text', 'class' => '', 'source' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'visible' => true, 'required' => false, 'user_defined' => true, 'default' => '0', 'visible_on_front' => false, 'unique' => false, 'is_configurable' => false, 'used_for_promo_rules' => false)); } $installer->endSetup();
<?php $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); $installer->addAttribute('customer', 'weibo_id', array('group' => 'Default', 'type' => 'varchar', 'label' => 'Weibo Id', 'input' => 'text', 'source' => 'eav/entity_attribute_source_text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'required' => 0, 'default' => 0, 'visible' => 0, 'adminhtml_only' => 1, 'user_defined' => 1)); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'weibo_id'); $oAttribute->setData('used_in_forms', array('adminhtml_customer')); $oAttribute->save(); $installer->endSetup(); $installer = new Mage_Customer_Model_Entity_Setup(); $installer->startSetup(); $installer->addAttribute('customer', 'qq_id', array('group' => 'Default', 'type' => 'varchar', 'label' => 'QQ Id', 'input' => 'text', 'source' => 'eav/entity_attribute_source_text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'required' => 0, 'default' => 0, 'visible' => 0, 'adminhtml_only' => 1, 'user_defined' => 1)); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'qq_id'); $oAttribute->setData('used_in_forms', array('adminhtml_customer')); $oAttribute->save(); $installer->endSetup();
/** * Prepare customer attribute values to save * * @param array $attr * @return array */ protected function _prepareValues($attr) { $data = parent::_prepareValues($attr); $data = array_merge($data, array('is_visible' => $this->_getValue($attr, 'visible', 1), 'is_visible_on_front' => $this->_getValue($attr, 'visible_on_front', 0), 'input_filter' => $this->_getValue($attr, 'input_filter', ''), 'lines_to_divide_multiline' => $this->_getValue($attr, 'lines_to_divide', 0), 'min_text_length' => $this->_getValue($attr, 'min_text_length', 0), 'max_text_length' => $this->_getValue($attr, 'max_text_length', 0))); return $data; }
<?php $installerCustomer = new Mage_Customer_Model_Entity_Setup('allopass_hipay_setup'); /* @var $installerCustomer Mage_Customer_Model_Entity_Setup */ $installerCustomer->startSetup(); $entityId = $installerCustomer->getEntityTypeId('customer'); $attribute = $installerCustomer->getAttribute($entityId, 'hipay_alias_oneclick'); if (!$attribute) { $installerCustomer->addAttribute('customer', 'hipay_alias_oneclick', array('type' => 'varchar', 'label' => 'Alias Oneclick Hipay', 'visible' => true, 'required' => false, 'unique' => false, 'sort_order' => 700, 'default' => 0, 'input' => 'text')); $usedInForms = array('adminhtml_customer'); $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'hipay_alias_oneclick'); $attribute->setData('used_in_forms', $usedInForms); $attribute->setData('sort_order', 700); $attribute->save(); } $entityId = $installerCustomer->getEntityTypeId('customer'); $attribute = $installerCustomer->getAttribute($entityId, 'hipay_alias_recurring'); if (!$attribute) { $installerCustomer->addAttribute('customer', 'hipay_alias_recurring', array('type' => 'varchar', 'label' => 'Alias Recurring Hipay', 'visible' => true, 'required' => false, 'unique' => false, 'sort_order' => 710, 'default' => 0, 'input' => 'text')); $usedInForms = array('adminhtml_customer'); $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'hipay_alias_recurring'); $attribute->setData('used_in_forms', $usedInForms); $attribute->setData('sort_order', 700); $attribute->save(); } $attribute = $installerCustomer->getAttribute($entityId, 'hipay_cc_number_enc'); if (!$attribute) { $installerCustomer->addAttribute('customer', 'hipay_cc_number_enc', array('type' => 'varchar', 'label' => 'Card number encrypted hipay', 'visible' => true, 'required' => false, 'unique' => false, 'sort_order' => 750, 'default' => 0, 'input' => 'text')); $usedInForms = array('adminhtml_customer'); $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'hipay_cc_number_enc'); $attribute->setData('used_in_forms', $usedInForms);
$connection->addColumn($tableOrderPayment, 'payone_clearing_bank_name', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 50, 'NULLABLE' => false, 'COMMENT' => 'Recipient Bank Name', 'DEFAULT' => '')); /** Alter table sales_flat_quote_payment */ $connection->addColumn($tableQuotePayment, 'payone_config_payment_method_id', array('TYPE' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'LENGTH' => 11, 'NULLABLE' => false, 'COMMENT' => 'payone_config_payment_method_id', 'DEFAULT' => 0)); $connection->addColumn($tableQuotePayment, 'payone_onlinebanktransfer_type', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 3, 'NULLABLE' => false, 'COMMENT' => 'Onlinebanktransfer: Type', 'DEFAULT' => '')); $connection->addColumn($tableQuotePayment, 'payone_bank_country', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 2, 'NULLABLE' => false, 'COMMENT' => 'Bank Country Code', 'DEFAULT' => '')); $connection->addColumn($tableQuotePayment, 'payone_account_number', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 14, 'NULLABLE' => false, 'COMMENT' => 'Account number', 'DEFAULT' => 0)); $connection->addColumn($tableQuotePayment, 'payone_account_owner', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 50, 'NULLABLE' => false, 'COMMENT' => 'Account owner', 'DEFAULT' => 0)); $connection->addColumn($tableQuotePayment, 'payone_bank_code', array('TYPE' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'LENGTH' => 8, 'NULLABLE' => false, 'COMMENT' => 'Bank Code', 'DEFAULT' => 0)); $connection->addColumn($tableQuotePayment, 'payone_bank_group', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 32, 'NULLABLE' => false, 'COMMENT' => 'Bank Group Type', 'DEFAULT' => '')); $connection->addColumn($tableQuotePayment, 'payone_pseudocardpan', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 19, 'NULLABLE' => false, 'COMMENT' => 'Pseudo Card PAN', 'DEFAULT' => '')); /** Alter table sales_flat_quote_address */ $connection->addColumn($tableQuoteAddress, 'payone_addresscheck_score', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 1, 'NULLABLE' => false, 'COMMENT' => 'AddressCheck Person Status Score (G, Y, R)', 'DEFAULT' => '')); $connection->addColumn($tableQuoteAddress, 'payone_addresscheck_date', array('TYPE' => Varien_Db_Ddl_Table::TYPE_DATETIME, 'NULLABLE' => false, 'DEFAULT' => '0000-00-00 00:00:00', 'COMMENT' => 'Addresscheck Date')); $connection->addColumn($tableQuoteAddress, 'payone_addresscheck_hash', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 32, 'NULLABLE' => false, 'DEFAULT' => '', 'COMMENT' => 'Addresscheck Hash')); $connection->addColumn($tableQuoteAddress, 'payone_protect_score', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 1, 'NULLABLE' => false, 'COMMENT' => 'Creditrating Score (G, Y, R)', 'DEFAULT' => '')); $connection->addColumn($tableQuoteAddress, 'payone_protect_date', array('TYPE' => Varien_Db_Ddl_Table::TYPE_DATETIME, 'NULLABLE' => false, 'COMMENT' => 'Creditrating Date', 'DEFAULT' => '0000-00-00 00:00:00')); $connection->addColumn($tableQuoteAddress, 'payone_protect_hash', array('TYPE' => Varien_Db_Ddl_Table::TYPE_TEXT, 'LENGTH' => 32, 'NULLABLE' => false, 'COMMENT' => 'Creditrating Score (G, Y, R)', 'DEFAULT' => '')); /** Alter table sales_flat_invoice */ $connection->addColumn($tableInvoice, 'payone_sequencenumber', array('TYPE' => Varien_Db_Ddl_Table::TYPE_SMALLINT, 'LENGTH' => 6, 'NULLABLE' => true, 'COMMENT' => 'Sequencenumber', 'DEFAULT' => null)); } // Add attributes: /* @var $installer Mage_Customer_Model_Entity_Setup */ $setup = new Mage_Customer_Model_Entity_Setup('core_setup'); $setup->addAttribute('customer_address', 'payone_addresscheck_score', array('type' => Varien_Db_Ddl_Table::TYPE_VARCHAR, 'label' => 'Payone Address Check Score', 'visible' => false, 'required' => false)); $setup->addAttribute('customer_address', 'payone_addresscheck_date', array('type' => $datetime, 'label' => 'Addresscheck Date', 'visible' => false, 'required' => false)); $setup->addAttribute('customer_address', 'payone_addresscheck_hash', array('type' => 'varchar', 'label' => 'Addresscheck Hash', 'visible' => false, 'required' => false)); $setup->addAttribute('customer_address', 'payone_protect_score', array('type' => Varien_Db_Ddl_Table::TYPE_VARCHAR, 'label' => 'Protect Score (G, Y, R)', 'visible' => false, 'required' => false)); $setup->addAttribute('customer_address', 'payone_protect_date', array('type' => $datetime, 'label' => 'Protect Date', 'visible' => false, 'required' => false)); $setup->addAttribute('customer_address', 'payone_protect_hash', array('type' => 'varchar', 'label' => 'Addresscheck Date', 'visible' => false, 'required' => false)); $setup->addAttribute('customer', 'payone_user_id', array('type' => 'int', 'visible' => false, 'required' => false)); $installer->endSetup();
public function __construct() { $entities = parent::getDefaultEntities(); return $entities; }
<?php $installerCustomer = new Mage_Customer_Model_Entity_Setup('allopass_hipay_setup'); /* @var $installerCustomer Mage_Customer_Model_Entity_Setup */ $installerCustomer->startSetup(); $entityId = $installerCustomer->getEntityTypeId('customer'); $attribute = $installerCustomer->getAttribute($entityId, 'hipay_cc_type'); if (!$attribute) { $installerCustomer->addAttribute('customer', 'hipay_cc_type', array('type' => 'varchar', 'label' => 'Card Type hipay', 'visible' => true, 'required' => false, 'unique' => false, 'sort_order' => 800, 'default' => 0, 'input' => 'text')); $usedInForms = array('adminhtml_customer'); $attribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'hipay_cc_type'); $attribute->setData('used_in_forms', $usedInForms); $attribute->setData('sort_order', 800); $attribute->save(); } $installerCustomer->endSetup();
<?php $this->startSetup(); $installer = new Mage_Customer_Model_Entity_Setup(); $installer->getConnection()->addColumn($installer->getTable('customer_group'), 'cost_percent', array('type' => Varien_Db_Ddl_Table::TYPE_FLOAT, 'nullable' => true, 'default' => 0.0, 'comment' => 'Default cost addition for dealers')); $this->endSetup();
<?php $installer = new Mage_Customer_Model_Entity_Setup('core_setup'); $installer->startSetup(); $vCustomerEntityType = $installer->getEntityTypeId('customer'); $vCustAttributeSetId = $installer->getDefaultAttributeSetId($vCustomerEntityType); $vCustAttributeGroupId = $installer->getDefaultAttributeGroupId($vCustomerEntityType, $vCustAttributeSetId); $installer->addAttribute('customer', 'openpay_user_id', array('label' => 'OpenPay User Id', 'input' => 'text', 'type' => 'varchar', 'forms' => array('adminhtml_customer'), 'required' => 0, 'global' => 1, 'visible' => 1, 'user_defined' => 1, 'visible_on_front' => 1)); $installer->addAttributeToGroup($vCustomerEntityType, $vCustAttributeSetId, $vCustAttributeGroupId, 'mobile', 0); $oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'openpay_user_id'); $oAttribute->setData('used_in_forms', array('adminhtml_customer')); $oAttribute->save(); $installer->endSetup();
/** * * NOTICE OF LICENSE * * This source file is subject to the GNU General Public License (GPL 3) * that is bundled with this package in the file LICENSE.txt * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade Payone_Core to newer * versions in the future. If you wish to customize Payone_Core for your * needs please refer to http://www.payone.de for more information. * * @category Payone * @package Payone_Core * @subpackage sql * @copyright Copyright (c) 2013 <*****@*****.**> - www.votum.de * @author Edward Mateja <*****@*****.**> * @license <http://www.gnu.org/licenses/> GNU General Public License (GPL 3) * @link http://www.votum.de */ /** @var $this Mage_Core_Model_Resource_Setup */ /** @var $installer Mage_Core_Model_Resource_Setup */ $installer = $this; $installer->startSetup(); // Add attributes: /* @var $installer Mage_Customer_Model_Entity_Setup */ $setup = new Mage_Customer_Model_Entity_Setup('core_setup'); $setup->addAttribute('customer', 'payone_last_payment_method', array('type' => Varien_Db_Ddl_Table::TYPE_VARCHAR, 'label' => 'Payone Last Payment Method', 'visible' => false, 'required' => false)); $installer->endSetup();