我试图在我的magento后端类别中有一个multiselect
选项。自定义类别属性
我有以下代码:
$installer = $this;
$installer->startSetup();
$attribute = array(
'group' => "General Information", // and this one
'label' => 'Location',
'type' => 'varchar',
'input' => 'multiselect',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => true,
'required' => false,
'is_user_defined' => true,
'option'=> array (
'value' => array(
'england'=> array(
0 =>'England'),
'scotland'=> array(
0 =>'Scotland')
)
)
);
$installer->addAttribute('catalog_category', 'bottom_description', $attribute);
$installer->endSetup();
这会在后台一个新的属性,但没有价值。
我需要配置其他任何东西,以便我可以看到这些值吗?
感谢
编辑:
在config.xml中我有:
<version>0.8.0</version>
我有另外一个文件:
mysql4-upgrade-0.7.0-0.8.0.php
该文件似乎不当我清除缓存并访问类别时运行。
任何想法?
是的。每次运行上面的命令,我都会增加'0.4.0','0.5.0'等版本并重命名文件'mysql4-upgrade-0.0.1-0.4.0.php','mysql4-upgrade-0.0.1 -0.5.0.php'匹配。但清除缓存后仍然没有值 – user1970557
版本应该更新为例如 upgrade-0.0.1-0.4.0.php到mysql4-upgrade-0.4.0-0.5.0.php – shivam
啊,那可能是问题了。它不是拾取我一直在做的任何更改 – user1970557