0
我想在管理配置中的多選字段中加載客戶屬性。 我得到的屬性,但只獲得他們每個人的首字母而不是全文。這是我的代碼,多選字段不能正確加載值 - Magento
public function toOptionArray()
{
$result = array();
$addressAttributes = Mage::getModel('customer/entity_address_attribute_collection');
foreach ($addressAttributes as $addressAttribute)
{
if (($addressLabel = $addressAttribute->getFrontendLabel()))
$result[$addressAttribute->getId()] = $addressLabel;
}
return $result;
}
,這是我的system.xml代碼
<fields>
<attributes>
<label>Attributes</label>
<frontend_type>multiselect</frontend_type>
<source_model>customerattributes/attributes</source_model>
<can_be_empty>1</can_be_empty>
<sort_order>1</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</attributes>
</fields>
在這個任何想法?