简体   繁体   English

如何在magento中为新的选择类型客户地址属性设置来源?

[英]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. 这与客户属性无关,但确实讨论了将下拉属性添加到产品中的问题,应该为您指明正确的方向。

Set Dropdown Option Value of a Product 设置产品的下拉选项值

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Magento-新客户属性 - Magento - New Customer Attribute 如何在Magento 1客户地址中添加新的自定义字段 - How to add new custom field in Magento 1 customer address 如何为magento客户定义新的source_model? - How to define a new source_model for magento customer? 在magento的销售订单网格集合中添加自定义客户地址属性 - Add custom customer address attribute in sales order grid collection in magento Magento-如何使用“次要电子邮件”客户属性登录? - Magento - How to Login with “Secondary Email” customer attribute? 创建一个已经存在的客户的客户地址-Magento - Create a customer address to already exist customer - Magento 在 Magento 中添加新的产品图像类型(属性) - Add New Product Image Type (Attribute) in Magento 如何在输入类型checbox中设置新属性并求和该属性的值? - How to set new attribute and sum the values of that attribute in input type checbox? 创建在magento 2中不起作用的客户属性 - Create customer attribute not working in magento 2 Magento-客户地址中的自定义属性,在结帐时未复制到sales_flat_order_address和sales_flat_quote_address - Magento - Custom attribute in customer address, not copied to sales_flat_order_address and sales_flat_quote_address on checkout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM