我試圖在我的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