我想为我的magento产品设置一个新的属性集。该属性应该是某些选项的选择类型。如何通过EAV设置默认值AddAttribute
$installer->addAttribute('catalog_product', 'reserve', array(
'backend_label' => 'Attribute Reserve',
'type' => 'varchar',
'input' => 'select',
#'backend' => 'eav/entity_attribute_source_boolean',
'frontend' => '',
'source' => '',
#'default' => 1,
'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
'visible' => true,
'required' => false,
'user_defined' => true,
'searchable' => false,
'filterable' => false,
'comparable' => false,
'visible_on_front' => false,
'visible_in_advanced_search' => false,
'unique' => false,
'option' => array(
'value' => array(
'optionone' => array('O'),
'optiontwo' => array('P'),
'optionthree' => array('Kein Angabe'),
)
),
));
如何将optionthree
设置为默认值?
谢谢你的回答,但我想要使用installscript来获取属性。 – koenig 2012-03-16 09:55:50