00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 $installer = $this;
00028
00029
00030 $installer->startSetup();
00031
00032 $defaultValue = 'container2';
00033
00034 $installer->addAttribute('catalog_product', 'options_container', array(
00035 'group' => 'Design',
00036 'type' => 'varchar',
00037 'backend' => '',
00038 'frontend' => '',
00039 'label' => 'Display product options in',
00040 'input' => 'select',
00041 'class' => '',
00042 'source' => 'catalog/entity_product_attribute_design_options_container',
00043 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
00044 'visible' => true,
00045 'required' => false,
00046 'user_defined' => false,
00047 'default' => $defaultValue,
00048 'searchable' => false,
00049 'filterable' => false,
00050 'comparable' => false,
00051 'visible_on_front' => false,
00052 'visible_in_advanced_search' => false,
00053 'unique' => false,
00054 )
00055 );
00056
00057 $newAttributeId = $installer->getAttributeId('catalog_product', 'options_container');
00058
00059 $installer->run("
00060 INSERT INTO {$this->getTable('catalog_product_entity_varchar')}
00061 (entity_id, entity_type_id, attribute_id, value)
00062 SELECT entity_id, entity_type_id, {$newAttributeId}, '{$defaultValue}' FROM {$this->getTable('catalog_product_entity')}
00063 ");
00064
00065 $installer->endSetup();