当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage_Eav_Model_Entity_Setup::removeAttribute方法代码示例

本文整理汇总了PHP中Mage_Eav_Model_Entity_Setup::removeAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Setup::removeAttribute方法的具体用法?PHP Mage_Eav_Model_Entity_Setup::removeAttribute怎么用?PHP Mage_Eav_Model_Entity_Setup::removeAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mage_Eav_Model_Entity_Setup的用法示例。


在下文中一共展示了Mage_Eav_Model_Entity_Setup::removeAttribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _addAttribute

 protected function _addAttribute($attributeCode)
 {
     $data = array('entity_type_id' => 4, 'attribute_code' => $attributeCode, 'backend_type' => 'text', 'frontend_input' => 'textarea', 'frontend_label' => 'messed up description ', 'is_required' => 0, 'is_user_defined' => 1, 'is_global' => 0, 'note' => 'delete me');
     $setup = new \Mage_Eav_Model_Entity_Setup('core_setup');
     $setup->removeAttribute('4', $attributeCode);
     $eav = $this->_getEavAttributeResourceModel()->setData($data)->save();
 }
开发者ID:eniuz,项目名称:EAVCleaner,代码行数:7,代码来源:MessdataCommand.php

示例2: execute

 /**
  * @param InputInterface   $input
  * @param OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->detectMagento($output, true);
     if ($this->initMagento()) {
         $entityType = $input->getArgument('entityType');
         try {
             $attributes = \Mage::getModel('eav/config')->getEntityAttributeCodes($entityType);
         } catch (\Mage_Core_Exception $e) {
             throw new \InvalidArgumentException($e->getMessage());
         }
         $setup = new \Mage_Eav_Model_Entity_Setup('core_setup');
         foreach ($input->getArgument('attributeCode') as $attributeCode) {
             if (!in_array($attributeCode, $attributes)) {
                 $message = sprintf('Attribute: "%s" does not exist for entity type: "%s"', $attributeCode, $entityType);
                 $output->writeln(sprintf('<comment>%s</comment>', $message));
             } else {
                 $setup->removeAttribute($entityType, $attributeCode);
                 $output->writeln(sprintf('<info>Successfully removed attribute: "%s" from entity type: "%s"</info>', $attributeCode, $entityType));
             }
         }
     }
 }
开发者ID:aedmonds,项目名称:n98-magerun,代码行数:26,代码来源:RemoveCommand.php

示例3: array

<?php

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('catalog_product', 'mw_storecredit');
$setup->addAttribute('catalog_product', 'mw_storecredit', array('label' => 'Store credit', 'type' => 'int', 'input' => 'text', 'visible' => true, 'required' => false, 'position' => 10));
$installer = $this;
$resource = Mage::getSingleton('core/resource');
$installer->startSetup();
$installer->run("\r\n\r\n\tDROP TABLE IF EXISTS {$resource->getTableName('storecreditpro/history')};\r\n\tCREATE TABLE {$resource->getTableName('storecreditpro/history')} (\r\n\t  `history_id` int(11) unsigned NOT NULL auto_increment,\r\n\t  `customer_id` int(11) unsigned NOT NULL default '0',\r\n\t  `transaction_type` int(2) unsigned NOT NULL,\r\n\t  `amount` decimal(12,4) DEFAULT '0.0000',\r\n\t  `balance` decimal(12,4) DEFAULT '0.0000',\r\n\t  `transaction_params` text DEFAULT '',\r\n\t  `transaction_detail` text DEFAULT '',\r\n\t  `order_id` int(11) NOT NULL,\r\n\t  `transaction_time` datetime,\r\n\t  `expired_time` datetime,\r\n\t  `remaining_credit` int(11) DEFAULT '0',\r\n\t  `status` tinyint(2) DEFAULT '1',\r\n\t  \r\n\t  PRIMARY KEY (`history_id`)\r\n\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\t\r\n\tDROP TABLE IF EXISTS {$resource->getTableName('storecreditpro/customer')};\r\n\tCREATE TABLE {$resource->getTableName('storecreditpro/customer')} (\r\n\t  `customer_id` int(11) unsigned NOT NULL,\r\n\t  `credit_balance` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t  `credit_updated_notification` tinyint(2) DEFAULT '1',\r\n\t  \r\n\t  PRIMARY KEY (`customer_id`)\r\n\t) ENGINE=InnoDB DEFAULT CHARSET=utf8;\r\n\r\n\t\r\n\t\r\n");
$sql_quote = "\r\n\t\tALTER TABLE `{$resource->getTableName('sales/quote')}` \r\n\t\t\r\n\t\tADD `mw_storecredit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_checkout_max` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_checkout_min` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_buy_credit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount_show` decimal(12,4) NULL DEFAULT '0.0000'\r\n\t\t\r\n\t\t";
$installer->run($sql_quote);
$sql_quote_address = "\r\n\t\tALTER TABLE `{$resource->getTableName('sales/quote_address')}` \r\n\t\t\r\n\t\tADD `mw_storecredit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_buy_credit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount_show` decimal(12,4) NULL DEFAULT '0.0000'\r\n\t\t\r\n\t\t";
$installer->run($sql_quote_address);
$sql_order = "\r\n\t\tALTER TABLE `{$resource->getTableName('sales/order')}` \r\n\t\t\r\n\t\tADD `mw_storecredit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_buy_credit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount_show` decimal(12,4) NULL DEFAULT '0.0000'\r\n\t\t\r\n\t\t";
$installer->run($sql_order);
$sql_invoice = "\r\n\t\tALTER TABLE `{$resource->getTableName('sales/invoice')}` \r\n\t\t\r\n\t\tADD `mw_storecredit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_buy_credit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount_show` decimal(12,4) NULL DEFAULT '0.0000'\r\n\t\t\r\n\t\t";
$installer->run($sql_invoice);
$sql_creditmemo = "\r\n\t\tALTER TABLE `{$resource->getTableName('sales/creditmemo')}` \r\n\t\t\r\n\t\tADD `mw_storecredit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_check_refund` tinyint(2) DEFAULT '0',\r\n\t\tADD `mw_storecredit_buy_credit` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount` decimal(12,4) NULL DEFAULT '0.0000',\r\n\t\tADD `mw_storecredit_discount_show` decimal(12,4) NULL DEFAULT '0.0000'\r\n\t\t\r\n\t\t";
$installer->run($sql_creditmemo);
$installer->endSetup();
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:20,代码来源:mysql4-install-0.1.0.php

示例4: catch

<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
try {
    $setup->removeAttribute('catalog_product', 'shipping_method');
    $setup->removeAttribute('catalog_product', 'allow_shipping');
} catch (Exception $e) {
}
$setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'allow_shipping', array('group' => 'Rental Shipping Method', 'type' => 'int', 'backend' => '', 'frontend' => '', 'label' => 'Customer Choses Shipping Method on Product Page', 'input' => 'boolean', 'source' => 'eav/entity_attribute_source_table', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'is_visible' => true, 'required' => false, 'user_defined' => true, 'default' => '', 'is_searchable' => false, 'is_filterable' => false, 'is_comparable' => false, 'is_visible_on_front' => true, 'is_visible_in_advanced_search' => false, 'is_used_in_product_listing' => false, 'unique' => false));
$setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'shipping_method', array('group' => 'Rental Shipping Method', 'type' => 'varchar', 'backend' => '', 'frontend' => '', 'source' => 'rshipping/entity_attribute_source_method', 'label' => 'Allowed Shipping Methods', 'input' => 'multiselect', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'is_visible' => true, 'required' => false, 'user_defined' => true, 'default' => '', 'is_searchable' => true, 'is_filterable' => false, 'is_comparable' => false, 'is_visible_on_front' => false, 'is_visible_in_advanced_search' => false, 'is_used_in_product_listing' => false, 'unique' => false, 'is_html_allowed_on_front' => true));
$installer->endSetup();
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:13,代码来源:mysql4-upgrade-0.1.0-0.1.1.php

示例5: array

<?php

$_installer = $this;
$_installer->startSetup();
// Product attributes
$_setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$_setup->removeAttribute(Mage_Catalog_Model_Product::ENTITY, 'reservation_cost');
$_setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'reservation_cost', array('group' => 'Prices', 'label' => 'Acquisition Cost', 'type' => 'decimal', 'input' => 'price', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'visible' => true, 'required' => false, 'user_defined' => false, 'default' => '0.0000', 'apply_to' => 'reservation', 'visible_on_front' => false, 'position' => 100));
$_fieldList = array('reservation_cost');
$_applyTo = array('reservation', 'configurable', 'bundle', 'grouped');
foreach ($_fieldList as $_field) {
    $_installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $_field, 'apply_to', implode(',', $_applyTo));
    $_installer->updateAttribute(Mage_Catalog_Model_Product::ENTITY, $_field, 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE);
}
$_installer->endSetup();
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:15,代码来源:mysql4-upgrade-1.1.6-1.1.7.php

示例6: array

<?php

$installer = $this;
$installer->startSetup();
// Product attributes
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute(Mage_Catalog_Model_Product::ENTITY, 'use_global_dates');
$setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'use_global_dates', array('group' => 'Payperrentals', 'label' => 'Use Global Event Dates', 'type' => 'int', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'visible' => true, 'required' => true, 'user_defined' => false, 'default' => 1, 'apply_to' => 'reservation', 'visible_on_front' => false, 'position' => 100));
$fieldList = array('use_global_dates');
$applyTo = array('reservation', 'configurable', 'bundle', 'grouped');
foreach ($fieldList as $field) {
    $installer->updateAttribute('catalog_product', $field, 'apply_to', implode(',', $applyTo));
    $installer->updateAttribute('catalog_product', $field, 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE);
}
$installer->endSetup();
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:15,代码来源:mysql4-upgrade-1.1.5-1.1.6.php

示例7:

<?php

$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
try {
    $setup->removeAttribute('catalog_product', 'payperrentals_quantity');
    $setup->removeAttribute('catalog_product', 'payperrentals_min_number');
    $setup->removeAttribute('catalog_product', 'payperrentals_min_type');
    $setup->removeAttribute('catalog_product', 'global_min_period');
    $setup->removeAttribute('catalog_product', 'payperrentals_max_number');
    $setup->removeAttribute('catalog_product', 'payperrentals_max_type');
    $setup->removeAttribute('catalog_product', 'global_max_period');
    $setup->removeAttribute('catalog_product', 'payperrentals_avail_number');
    $setup->removeAttribute('catalog_product', 'payperrentals_avail_type');
    $setup->removeAttribute('catalog_product', 'global_turnover_after');
    $setup->removeAttribute('catalog_product', 'payperrentals_avail_numberb');
    $setup->removeAttribute('catalog_product', 'payperrentals_avail_typeb');
    $setup->removeAttribute('catalog_product', 'global_turnover_before');
    $setup->removeAttribute('catalog_product', 'payperrentals_deposit');
    $setup->removeAttribute('catalog_product', 'payperrentals_has_shipping');
    $setup->removeAttribute('catalog_product', 'payperrentals_has_multiply');
    $setup->removeAttribute('catalog_product', 'payperrentals_pricingtype');
    $setup->removeAttribute('catalog_product', 'payperrentals_use_send_return');
    $setup->removeAttribute('catalog_product', 'payperrentals_use_times');
    $setup->removeAttribute('catalog_product', 'payperrentals_padding_days');
    $setup->removeAttribute('catalog_product', 'disabled_with_message');
    $setup->removeAttribute('catalog_product', 'res_excluded_daysweek');
    $setup->removeAttribute('catalog_product', 'global_excludedays');
    $setup->removeAttribute('catalog_product', 'allow_overbooking');
    $setup->removeAttribute('catalog_product', 'res_excluded_dates');
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:31,代码来源:mysql4-install-0.1.0.php

示例8: array

<?php

$installer = $this;
$installer->startSetup();
// remove attributes
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('catalog_product', 'r4q_enabled');
$setup->removeAttribute('catalog_product', 'r4q_order_disabled');
$setup->removeAttribute('catalog_product', 'r4q_hide_price');
// add attributes
$installer->addAttribute('catalog_product', 'r4q_enabled', array('backend' => '', 'type' => 'int', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'group' => 'Request4Quote', 'label' => 'Allow Quotation Requests', 'class' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'default_value' => 0, 'visible' => true, 'used_in_product_listing' => true, 'is_visible_on_front' => false, 'required' => false, 'user_defined' => false, 'default' => '0', 'apply_to' => 'simple,grouped,configurable,virtual,bundle,downloadable,reservation,membershippackage', 'visible_on_front' => false, 'position' => 1));
$installer->addAttribute('catalog_product', 'r4q_order_disabled', array('backend' => '', 'type' => 'int', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'group' => 'Request4Quote', 'label' => 'Disable Add To Cart', 'class' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'default_value' => 0, 'visible' => true, 'used_in_product_listing' => true, 'is_visible_on_front' => false, 'required' => false, 'user_defined' => false, 'default' => '0', 'apply_to' => 'simple,grouped,configurable,virtual,bundle,downloadable,reservation,membershippackage', 'visible_on_front' => false, 'position' => 2));
$installer->addAttribute('catalog_product', 'r4q_hide_price', array('backend' => '', 'type' => 'int', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'group' => 'Request4Quote', 'label' => 'Hide Price', 'class' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'default_value' => 0, 'visible' => true, 'used_in_product_listing' => true, 'is_visible_on_front' => false, 'required' => false, 'user_defined' => false, 'default' => '0', 'note' => 'Warning: if the price is hidden and the product is orderable, prices will show in checkout', 'apply_to' => 'simple,grouped,configurable,virtual,bundle,downloadable,reservation,membershippackage', 'visible_on_front' => false, 'position' => 3));
$installer->endSetup();
开发者ID:VinuWebtech,项目名称:production267,代码行数:14,代码来源:mysql4-upgrade-1.0.0-1.1.0.php

示例9: array

$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'customercredit_hidden_tax', 'decimal(12,4) NULL');
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'base_customercredit_shipping_hidden_tax', 'decimal(12,4) NULL');
$installer->getConnection()->addColumn($installer->getTable('sales/order'), 'customercredit_shipping_hidden_tax', 'decimal(12,4) NULL');
//update sales_invoice
$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'base_customercredit_hidden_tax', 'decimal(12,4) NULL');
$installer->getConnection()->addColumn($installer->getTable('sales/invoice'), 'customercredit_hidden_tax', 'decimal(12,4) NULL');
//update sales_creditmemo
$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'base_customercredit_hidden_tax', 'decimal(12,4) NULL');
$installer->getConnection()->addColumn($installer->getTable('sales/creditmemo'), 'customercredit_hidden_tax', 'decimal(12,4) NULL');
//update sales_order_item
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'base_customercredit_hidden_tax', 'decimal(12,4) NULL');
$installer->getConnection()->addColumn($installer->getTable('sales/order_item'), 'customercredit_hidden_tax', 'decimal(12,4) NULL');
//remove attribute
//$setup->removeAttribute('catalog_product', 'credit_amount');
//$setup->removeAttribute('catalog_product', 'credit_value');
$setup->removeAttribute('catalog_product', 'storecredit_value');
$setup->removeAttribute('catalog_product', 'storecredit_from');
$setup->removeAttribute('catalog_product', 'storecredit_to');
$setup->removeAttribute('catalog_product', 'storecredit_dropdown');
$setup->removeAttribute('catalog_product', 'storecredit_type');
/* add Store Credit product attributes */
/**
 * add storecredit_value attribute
 */
$att_storecredit_value = array('group' => 'Prices', 'type' => 'decimal', 'input' => 'price', 'class' => 'validate-number', 'label' => 'Store Credit value', 'backend' => '', 'frontend' => '', 'source' => '', 'visible' => 1, 'user_defined' => 1, 'used_for_price_rules' => 1, 'position' => 4, 'unique' => 0, 'default' => '', 'sort_order' => 101);
$setup->addAttribute('catalog_product', 'storecredit_value', $att_storecredit_value);
$storecreditValue = Mage::getModel('catalog/resource_eav_attribute')->load($setup->getAttributeId('catalog_product', 'storecredit_value'));
$storecreditValue->addData(array('is_global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'is_required' => 1, 'apply_to' => array('customercredit'), 'is_configurable' => 1, 'is_searchable' => 0, 'is_visible_in_advanced_search' => 0, 'is_comparable' => 0, 'is_filterable' => 0, 'is_filterable_in_search' => 1, 'is_used_for_promo_rules' => 1, 'is_html_allowed_on_front' => 0, 'is_visible_on_front' => 0, 'used_in_product_listing' => 1, 'used_for_sort_by' => 0))->save();
//show description of Store Credit
$attr = array('group' => 'Prices', 'type' => 'int', 'input' => 'boolean', 'label' => 'Show description of Store Credit value', 'backend' => '', 'frontend' => '', 'source' => '', 'visible' => 1, 'user_defined' => 1, 'used_for_price_rules' => 1, 'position' => 10, 'unique' => 0, 'default' => '', 'sort_order' => 101, 'is_global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'is_required' => 0, 'apply_to' => array('customercredit'), 'is_configurable' => 1, 'is_searchable' => 0, 'is_visible_in_advanced_search' => 0, 'is_comparable' => 0, 'is_filterable' => 0, 'is_filterable_in_search' => 1, 'is_used_for_promo_rules' => 1, 'is_html_allowed_on_front' => 0, 'is_visible_on_front' => 0, 'used_in_product_listing' => 1, 'used_for_sort_by' => 0);
/**
开发者ID:javik223,项目名称:Evron-Magento,代码行数:31,代码来源:mysql4-upgrade-0.1.1-0.2.0.php

示例10: catch

<?php

/** @var $this Mage_Core_Model_Resource_Setup */
$_installer = $this;
$_installer->startSetup();
$_setup = new Mage_Eav_Model_Entity_Setup('core_setup');
try {
    $_setup->removeAttribute('catalog_product', 'allow_shipping');
} catch (Exception $_e) {
    Mage::logException($_e);
}
$_setup->addAttribute(Mage_Catalog_Model_Product::ENTITY, 'allow_shipping', array('group' => 'Rental Shipping Method', 'type' => 'int', 'backend' => '', 'frontend' => '', 'label' => 'Customer can chose Shipping Method on Product Page', 'input' => 'select', 'source' => 'eav/entity_attribute_source_boolean', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 'is_visible' => true, 'required' => false, 'user_defined' => true, 'default' => '', 'is_searchable' => false, 'is_filterable' => false, 'is_comparable' => false, 'is_visible_on_front' => true, 'is_visible_in_advanced_search' => false, 'is_used_in_product_listing' => false, 'unique' => false));
$_installer->endSetup();
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:13,代码来源:upgrade-0.1.7-0.1.7.1.php

示例11: array

<?php

/**
 * @var $installer Mage_Core_Model_Resource_Setup
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('customer', 'membershippackage_day');
$setup->removeAttribute('customer', 'membershippackage_month');
$setup->removeAttribute('customer', 'membershippackage_year');
$setup->removeAttribute('customer', 'membershippackage_payment');
/** fix sort orders */
$setup->updateAttribute('customer', 'membershippackage_name', array('position' => 10));
$setup->updateAttribute('customer', 'membershippackage_enabled', array('position' => 20));
$setup->updateAttribute('customer', 'membershippackage_cc', array('position' => 30));
/** Add membershippackage_ccexpiremonth, membershippackage_ccexpireyear, membershippackage_otherpayment, membershippackage_start, membershippackage_lastbilled, membershippackage_notes  */
$setup->addAttribute('customer', 'membershippackage_ccmonth', array('type' => 'text', 'input' => 'select', 'group' => 'Membership', 'label' => 'CC Expires Month', 'global' => 1, 'visible' => 1, 'required' => 0, 'position' => 31, 'user_defined' => 1, 'default' => '0', 'visible_on_front' => 0, 'source' => 'payperrentals/customer_membershippackage_ccmonth'));
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) {
    Mage::getSingleton('eav/config')->getAttribute('customer', 'membershippackage_ccmonth')->setData('used_in_forms', array('adminhtml_customer_membership'))->save();
}
$setup->addAttribute('customer', 'membershippackage_ccyear', array('type' => 'text', 'input' => 'select', 'group' => 'Membership', 'label' => 'CC Expires Year', 'global' => 1, 'visible' => 1, 'required' => 0, 'position' => 32, 'user_defined' => 1, 'default' => '0', 'visible_on_front' => 0, 'source' => 'payperrentals/customer_membershippackage_ccyear'));
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) {
    Mage::getSingleton('eav/config')->getAttribute('customer', 'membershippackage_ccyear')->setData('used_in_forms', array('adminhtml_customer_membership'))->save();
}
$setup->addAttribute('customer', 'membershippackage_otherpayment', array('type' => 'varchar', 'input' => 'textarea', 'group' => 'Membership', 'label' => 'Other Payment Method Details', 'global' => 1, 'visible' => 1, 'required' => 0, 'position' => 40, 'user_defined' => 1, 'default' => '0', 'visible_on_front' => 0));
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) {
    Mage::getSingleton('eav/config')->getAttribute('customer', 'membershippackage_otherpayment')->setData('used_in_forms', array('adminhtml_customer_membership'))->save();
}
$setup->addAttribute('customer', 'membershippackage_start', array('type' => 'datetime', 'input' => 'datetime', 'group' => 'Membership', 'label' => 'Membership Start Date', 'global' => 1, 'visible' => 1, 'required' => 0, 'position' => 50, 'user_defined' => 1, 'default' => '0', 'visible_on_front' => 0));
if (version_compare(Mage::getVersion(), '1.4.2', '>=')) {
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:31,代码来源:mysql4-upgrade-1.2.1.1-1.2.1.2.php

示例12:

<?php

$installer = $this;
$installer->startSetup();
// 1. Remove display on homepage category attribute - Functionality no longer needed
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('catalog_category', 'display_on_homepage');
$installer->endSetup();
开发者ID:Rodrifer,项目名称:candyclub,代码行数:8,代码来源:mysql4-upgrade-0.1.4-0.1.5.php

示例13: array

<?php

/**
 * @var $installer Mage_Core_Model_Resource_Setup
 */
$installer = $this;
$installer->startSetup();
// Product attributes
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('catalog_product', 'inventory_serialized');
$setup->addAttribute('catalog_product', 'inventory_serialized', array('group' => 'Rental Bookings', 'label' => 'Inventory Serialized', 'input' => 'text', 'type' => 'text', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE, 'visible' => false, 'default' => 'not_updated', 'required' => false, 'user_defined' => false, 'apply_to' => 'reservation', 'visible_on_front' => false, 'position' => 27));
$fieldList = array('inventory_serialized');
$applyTo = array('reservation', 'configurable', 'bundle', 'grouped');
foreach ($fieldList as $field) {
    $installer->updateAttribute('catalog_product', $field, 'apply_to', implode(',', $applyTo));
    $installer->updateAttribute('catalog_product', $field, 'is_global', Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE);
    $installer->updateAttribute('catalog_product', $field, 'is_visible', false);
}
$installer->endSetup();
开发者ID:hueyl77,项目名称:fourwindsgear,代码行数:19,代码来源:mysql4-upgrade-1.2.0.1-1.2.0.2.php

示例14: int

<?php

$installer = $this;
$installer->startSetup();
$inst = new Mage_Eav_Model_Entity_Setup('core_setup');
$inst->removeAttribute('catalog_product', 'prolabel_product_display');
$inst->removeAttribute('catalog_product', 'prolabel_product_position');
$inst->removeAttribute('catalog_product', 'prolabel_product_image');
$inst->removeAttribute('catalog_product', 'prolabel_product_text');
$inst->removeAttribute('catalog_product', 'prolabel_product_positionstyle');
$inst->removeAttribute('catalog_product', 'prolabel_product_fontstyle');
$inst->removeAttribute('catalog_product', 'prolabel_category_display');
$inst->removeAttribute('catalog_product', 'prolabel_category_position');
$inst->removeAttribute('catalog_product', 'prolabel_category_image');
$inst->removeAttribute('catalog_product', 'prolabel_category_text');
$inst->removeAttribute('catalog_product', 'prolabel_category_positionstyle');
$inst->removeAttribute('catalog_product', 'prolabel_category_fontstyle');
$inst->removeAttribute('catalog_product', 'prolabel_p_display');
$inst->removeAttribute('catalog_product', 'prolabel_p_position');
$inst->removeAttribute('catalog_product', 'prolabel_p_image');
$inst->removeAttribute('catalog_product', 'prolabel_p_text');
$inst->removeAttribute('catalog_product', 'prolabel_p_positionstyle');
$inst->removeAttribute('catalog_product', 'prolabel_p_fontstyle');
$inst->removeAttribute('catalog_product', 'prolabel_c_display');
$inst->removeAttribute('catalog_product', 'prolabel_c_position');
$inst->removeAttribute('catalog_product', 'prolabel_c_image');
$inst->removeAttribute('catalog_product', 'prolabel_c_text');
$inst->removeAttribute('catalog_product', 'prolabel_c_positionstyle');
$inst->removeAttribute('catalog_product', 'prolabel_c_fontstyle');
$installer->run("\n\nCREATE TABLE  {$this->getTable('prolabels/label')} (\n  `rules_id` int(11) NOT NULL AUTO_INCREMENT,\n  `name` varchar(40) NOT NULL,\n  `conditions_serialized` text,\n  `status` tinyint(1) unsigned NOT NULL DEFAULT '0',\n  `system` tinyint(1) NOT NULL DEFAULT '0',\n  `product_position` varchar(25) DEFAULT NULL,\n  `product_image` varchar(50) DEFAULT NULL,\n  `product_image_text` varchar(50) DEFAULT NULL,\n  `product_position_style` varchar(80) DEFAULT NULL,\n  `product_font_style` varchar(80) DEFAULT NULL,\n  `product_round_method` varchar(15) DEFAULT NULL,\n  `product_round` varchar(5) DEFAULT NULL,\n  `category_position` varchar(25) DEFAULT NULL,\n  `category_image` varchar(50) DEFAULT NULL,\n  `category_image_text` varchar(50) DEFAULT NULL,\n  `category_position_style` varchar(80) DEFAULT NULL,\n  `category_font_style` varchar(80) DEFAULT NULL,\n  `category_round_method` varchar(15) DEFAULT NULL,\n  `category_round` varchar(5) DEFAULT NULL,\n  `category_min_stock` varchar(5) DEFAULT NULL,\n  `category_out_stock` tinyint(1) unsigned DEFAULT NULL,\n  `category_out_stock_image` varchar(45) DEFAULT NULL,\n  `product_min_stock` varchar(5) DEFAULT NULL,\n  `product_out_stock` tinyint(1) unsigned DEFAULT NULL,\n  `product_out_stock_image` varchar(45) DEFAULT NULL,\n  PRIMARY KEY (`rules_id`)\n) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n\nINSERT INTO {$this->getTable('prolabels/label')} (`rules_id`,`name`,`conditions_serialized`,`status`,`system`,`product_position`,`product_image`,`product_image_text`,`product_position_style`,`product_font_style`,`product_round_method`,`product_round`,`category_position`,`category_image`,`category_image_text`,`category_position_style`,`category_font_style`,`category_round_method`,`category_round`,`category_min_stock`,`category_out_stock`,`category_out_stock_image`,`product_min_stock`,`product_out_stock`,`product_out_stock_image`) VALUES\n (1,'On Sale','a:6:{s:4:\"type\";s:32:\"prolabels/rule_condition_combine\";s:9:\"attribute\";N;s:8:\"operator\";N;s:5:\"value\";b:1;s:18:\"is_value_processed\";N;s:10:\"aggregator\";s:3:\"all\";}',0,1,'bottom-left',NULL,'#discount_amount#',NULL,NULL,'round','1','top-left',NULL,NULL,NULL,NULL,'round','1',NULL,NULL,NULL,NULL,NULL,NULL),\n (2,'In Stock','a:6:{s:4:\"type\";s:32:\"prolabels/rule_condition_combine\";s:9:\"attribute\";N;s:8:\"operator\";N;s:5:\"value\";b:1;s:18:\"is_value_processed\";N;s:10:\"aggregator\";s:3:\"all\";}',0,1,'top-right',NULL,NULL,NULL,NULL,'round','1','top-left',NULL,NULL,NULL,NULL,'round','1',NULL,0,NULL,'5',1,NULL),\n (3,'Is New','a:6:{s:4:\"type\";s:32:\"prolabels/rule_condition_combine\";s:9:\"attribute\";N;s:8:\"operator\";N;s:5:\"value\";b:1;s:18:\"is_value_processed\";N;s:10:\"aggregator\";s:3:\"all\";}',0,1,'top-left',NULL,NULL,NULL,NULL,'round','1','top-left',NULL,NULL,NULL,NULL,'round',NULL,NULL,NULL,NULL,NULL,NULL,NULL);\n\nCREATE TABLE  {$this->getTable('prolabels/index')} (\n  `id` bigint(20) NOT NULL AUTO_INCREMENT,\n  `rules_id` int(11) NOT NULL,\n  `product_id` int(10) unsigned NOT NULL,\n  PRIMARY KEY (`id`),\n  KEY `product` (`product_id`),\n  KEY `tm_fk_constraint_rules` (`rules_id`),\n  CONSTRAINT `tm_fk_constraint_rules` FOREIGN KEY (`rules_id`) REFERENCES {$this->getTable('prolabels/label')} (`rules_id`) ON DELETE CASCADE ON UPDATE CASCADE,\n  CONSTRAINT `tm_fk_constraint_rules_product` FOREIGN KEY (`product_id`) REFERENCES {$this->getTable('catalog/product')} (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n\nCREATE TABLE  {$this->getTable('prolabels/store')} (\n  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,\n  `rule_id` int(11) NOT NULL,\n  `store_id` int(11) NOT NULL,\n  PRIMARY KEY (`id`),\n  KEY `tm_fk_constraint_pro_store` (`rule_id`),\n  CONSTRAINT `tm_fk_constraint_pro_store` FOREIGN KEY (`rule_id`) REFERENCES {$this->getTable('prolabels/label')} (`rules_id`) ON DELETE CASCADE ON UPDATE CASCADE\n) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;\n\n");
$installer->endSetup();
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:31,代码来源:mysql4-upgrade-1.0.6-2.0.0.php

示例15: updateValue

 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/AW-LICENSE.txt
 *
 * =================================================================
 *                 MAGENTO EDITION USAGE NOTICE
 * =================================================================
 * This software is designed to work with Magento community edition and
 * its use on an edition other than specified is prohibited. aheadWorks does not
 * provide extension support in case of incorrect edition use.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Mobile
 * @version    1.6.7
 * @copyright  Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE.txt
 */
function updateValue(Mage_Eav_Model_Entity_Setup $setup, $entityTypeId, $code, $key, $value)
{
    $id = $setup->getAttribute($entityTypeId, $code, 'attribute_id');
    $setup->updateAttribute($entityTypeId, $id, $key, $value);
}
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->removeAttribute('catalog_product', 'mobile_description');
$setup->addAttribute('catalog_product', 'mobile_description', array('type' => 'text', 'backend' => '', 'frontend' => '', 'label' => 'Mobile Description', 'input' => 'textarea', 'class' => '', 'source' => '', 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, 'visible' => true, 'group' => 'Mobile Options', 'required' => false, 'user_defined' => false, 'default' => '', 'searchable' => true, 'filterable' => false, 'comparable' => false, 'is_wysiwyg_enabled' => true, 'is_html_allowed_on_front' => true, 'visible_on_front' => false, 'visible_in_advanced_search' => false, 'unique' => false));
updateValue($setup, 'catalog_product', 'mobile_description', 'is_global', 0);
updateValue($setup, 'catalog_product', 'mobile_description', 'is_wysiwyg_enabled', true);
updateValue($setup, 'catalog_product', 'mobile_description', 'is_html_allowed_on_front', true);
$installer->endSetup();
开发者ID:buttasg,项目名称:cowgirlk,代码行数:31,代码来源:mysql4-install-1.0.php


注:本文中的Mage_Eav_Model_Entity_Setup::removeAttribute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。