-
Notifications
You must be signed in to change notification settings - Fork 2
/
a1.php
35 lines (29 loc) · 1.26 KB
/
a1.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup; //Mage_Eav_Model_Entity_Setup,Mage_Catalog_Model_Resource_Setup,
$installer->startSetup();
$installer->addAttribute('catalog_product', 'featured', array(
'type' => 'int',
'backend_type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Is Featured',
'input' => 'boolean',
'frontend_class' => '',
'source' => 'eav/entity_attribute_source_boolean',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => false,
'required' => false,
'user_defined' => true,
'default' => '',
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'unique' => false,
'apply_to' => '',
'is_configurable' => false
));
$installer->addAttributeToSet('catalog_product', 'Default', 'General', 'featured');
$installer->endSetup();