Magento - 将自定义属性添加到客户模型
问题描述:
我正在尝试向客户模型添加属性。它是允许客户在注册时选择工作类别的选择列表:Magento - 将自定义属性添加到客户模型
$this->addAttribute('customer', 'customer_sector', array(
'label' => 'Settore',
'type' => 'int',
'input' => 'select',
'default' => '0',
'backend' => '',
'frontend' => '',
'default_value' => '',
'visible' => 1,
'user_defined' => 1,
'searchable' => 1,
'filterable' => 1,
'visible_on_front' => 0,
'visible' => true,
'visible_on_front' => true,
'required' => false,
// what i have to add on 'global'?
//'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'option' => array ('value' => array(1 => array('opzione 1'),2 => array('opzione 2'), 3 => array('opzione 3')))
));
是我的代码是否正确?我在magentocommerce.com上发现了一个指南(这里也有很多类似的问题),但它解释了如何在产品上添加自定义属性,所以我更愿意在这里提问。
THX
卢克
和你的Magento的版本是什么? – 2012-01-03 15:50:40
@AntonS:Magento 1.4.1.1 – Luke 2012-01-03 16:04:08