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 $installer->addAttribute('catalog_product', 'disable_googlecheckout', array(
00033 'type' => 'int',
00034 'backend' => '',
00035 'frontend' => '',
00036 'label' => 'Not available for purchase with Google Checkout',
00037 'input' => 'select',
00038 'class' => '',
00039 'source' => 'eav/entity_attribute_source_boolean',
00040 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
00041 'visible' => true,
00042 'required' => false,
00043 'user_defined' => false,
00044 'default' => '0',
00045 'searchable' => false,
00046 'filterable' => false,
00047 'comparable' => false,
00048 'visible_on_front' => false,
00049 'unique' => false,
00050 'apply_to' => '',
00051 'is_configurable' => false
00052 ));
00053
00054 $attributeId = $installer->getAttributeId('catalog_product', 'disable_googlecheckout');
00055
00056 foreach ($installer->getAllAttributeSetIds('catalog_product') as $attributeSetId) {
00057 try {
00058 $attributeGroupId = $installer->getAttributeGroupId('catalog_product', $attributeSetId, 'Prices');
00059 } catch (Exception $e) {
00060 $attributeGroupId = $installer->getDefaultAttributeGroupId('catalog_product', $attributeSetId);
00061 }
00062 $installer->addAttributeToSet('catalog_product', $attributeSetId, $attributeGroupId, $attributeId);
00063 }
00064 $installer->endSetup();