我正在使用Magento Community 1.9.0.0。Magento - 多選擇類別屬性不保存
我已經以編程方式創建了一個多選的自定義分類屬性。該屬性可以在我的管理員類別部分中看到。當我選擇任何值 - 無論是一個或多個,並按保存我得到一個成功的保存消息,但值永遠不會保存。
然後,我也試着創建類別屬性的擴展。這有同樣的問題。當我聯繫支持時,他們說
類別實體不支持多選,因此這種類型的屬性不適用於類別。
這是真的嗎? CE-1.9上的多選不能用於類別屬性?
這裏是我使用編程創建它的代碼:
require_once('app/Mage.php');
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));
$installer = new Mage_Sales_Model_Mysql4_Setup;
$attribute = array(
'type' => 'text',
'label'=> 'Room Type',
'input' => 'multiselect',
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'default' => "",
'group' => "General Information",
'option' => array (
'value' => array(
'kitchen' => array('Kitchen'),
'bedroom' => array('Bedroom'),
'bathroom' => array('Bathroom'),
'loft' => array('Loft'),
'basement' => array('Basement'),
'lounge' => array('Lounge')
)
)
);
$installer->addAttribute('catalog_category', 'room_type', $attribute);
$installer->endSetup();
Multiselect應該可以使用類別屬性。 請按照本教程。這是爲textarea,但你可以以類似的方式爲下拉菜單創建一個。 http://www.atwix.com/magento/add-category-attribute/ – Harit 2014-12-19 10:54:54
你知道爲什麼它可能沒有保存的任何理由嗎? – 2014-12-19 10:55:51
您是否創建了源模型?在這裏發佈你的代碼。 – Harit 2014-12-19 10:56:22