我一直在試圖通過編程方式爲後端magento中的類別創建一個屬性。所以,我遵循http://www.hesselbom.net/magento-custom-attributes-with-selectbox中的步驟,它完美地工作,甚至我可以保存選定的值。而如果我嘗試創建文本框屬性,則值不會被保存。任何人都可以指導我如何做到這一點?在magento中保存類別的自定義屬性值
以下是我的代碼。
$installer->addAttribute('catalog_category', 'custom_textfield', array(
'type' => 'varchar',
'label' => 'Custom field',
'input' => 'text',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible' => TRUE,
'required' => FALSE,
'default' => ''
));
$attributeId = $installer->getAttributeId($entityTypeId, 'custom_textfield');
我也相應地更新了配置文件中的版本。
不,它不適合我。 –
它顯示在類別中,或者你檢查數據庫的條目? –
在哪裏以及如何操作?由於我是magento新手,我不知道該在哪裏做? –