欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Programatically create a magento ‘Yes/No’ product attribute

程序员文章站 2022-06-04 11:06:20
...
$this->addAttribute( Mage_Catalog_Model_Product::ENTITY, 'yes_no_attribute', array(
            'group' => 'General',
            'type' => 'tinyint',
            'backend' => '',
            'frontend' => '',
            'label' => 'Featured Product?',
            'input' => 'boolean',
            'source' => 'eav/entity_attribute_source_table',
            'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => true,
            'default' => '',
            'searchable' => false,
            'filterable' => true,
            'comparable' => false,
            'visible_on_front' => true,
            'visible_in_advanced_search' => true,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => 'simple',
        ) );