[英]How to set the source for a new select type customer address attribute in magento?
Here I'm trying to add a select type customer address attribute. 在这里,我尝试添加选择类型客户地址属性。 Can I use an array to set the option values and labels?
我可以使用数组设置选项值和标签吗?
$newAttributeName = "adt";
$attribute = array(
'type' => 'int',
'input' => 'select',
'label' => 'Ad TYPE',
'visible' => true,
'required' => true,
'user_defined' => true,
'searchable' => true,
'filterable' => true,
'comparable' => true,
'visible_on_front' => true,
'source' =>
); );
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$setup->addAttribute('customer_address', $newAttributeName, $attribute);
Can someone give me a help with this? 有人可以帮我这个忙吗?
This page has some information that might help answer your question. 此页面上的某些信息可能有助于回答您的问题。 It's not about customer attributes, but it does discuss adding dropdown attributes to products and should point you in the right direction.
这与客户属性无关,但确实讨论了将下拉属性添加到产品中的问题,应该为您指明正确的方向。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.