为自定义类别属性启用wysiwyg编辑器

erw*_*mit 3 magento magento-1.6

我为类别创建了自定义属性.我以为我用"'wysiwyg_enabled'=> true"启用WYSIWYG编辑器,但WYSIWYG没有出现.

$installer->addAttribute(Mage_Catalog_Model_Category::ENTITY, 'shortdescription', array(
    'type'              => 'text',
    'backend'           => '',
    'frontend'          => '',
    'label'             => 'Short description',
    'input'             => 'textarea',
    'class'             => '',
    'source'            => '',
    'global'            => '0',
    'visible'           => true,
    'required'          => false,
    'user_defined'      => true,
    'default'           => '',
    'searchable'        => false,
    'filterable'        => false,
    'comparable'        => false,
    'visible_on_front'  => true,
    'used_in_product_listing' => false,
    'unique'            => false,
    'wysiwyg_enabled'   => true,
    'apply_to'          => '',
    'is_configurable'   => true
)); 
Run Code Online (Sandbox Code Playgroud)

任何帮助,将不胜感激.我使用magento 1.6.2.

Ren*_*art 8

尝试(没有所有附加选项)

 <?php
 $this->startSetup();
 $this->addAttribute('catalog_category', 'custom_attribute', array(
     'group'         => 'General',
     'input'         => 'textarea',
     'type'          => 'text',
     'label'         => 'Custom attribute',
     'backend'       => '',
     'visible'       => true,
     'required'      => false,
     'wysiwyg_enabled' => true,
     'visible_on_front' => true,
     'is_html_allowed_on_front' => true,
     'global'        => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
 ));

 $this->endSetup();
Run Code Online (Sandbox Code Playgroud)

假设你的设置$this->startSetup()是瞬间的Mage_Catalog_Model_Resource_Eav_Mysql4_Setup

<global>
    <resources>
        <add_category_attribute>
            <setup>
                <module>...</module>
                <class>Mage_Catalog_Model_Resource_Eav_Mysql4_Setup</class>
            </setup>
Run Code Online (Sandbox Code Playgroud)

你也可以这样做

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

$setup->addAttribute('catalog_category' ...
Run Code Online (Sandbox Code Playgroud)

http://www.atwix.com/magento/add-category-attribute/