设置客户属性的前端标签-magento

设置客户属性的前端标签-magento,magento,Magento,我使用这个脚本设置了一个customer属性(我只粘贴了它的一部分,与属性相关的部分) 我想将属性的前端标签设置为“你多大了?”但将管理员标签设置为“年龄”。我怎么能这样做 提前谢谢,好的,我在查看了magento之后设法做到了 $labels = array(); $labels[0] = 'Age';//default store label $labels[1] = 'Label for store with id 1'; $oAttribute = Mage::getSingleton(

我使用这个脚本设置了一个customer属性(我只粘贴了它的一部分,与属性相关的部分)

我想将属性的前端标签设置为“你多大了?”但将管理员标签设置为“年龄”。我怎么能这样做


提前谢谢,

好的,我在查看了magento之后设法做到了

$labels = array();
$labels[0] = 'Age';//default store label
$labels[1] = 'Label for store with id 1';
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'age');
$oAttribute->setData('store_labels', $labels);
$oAttribute->save();
这就成功了


希望它能帮助别人

我在这方面也遇到了麻烦,在属性的初始创建过程中,我从未成功地粘贴标签。我必须按照下面的答案回答。然而,一个建议是使用$setup->\u prepareValues($data\u array);为addAttribute()的第三个参数初始化数组。这将返回一个数组,其中包含用于设置属性的所有有效选项键。要更新产品属性,我必须使用此
Mage::getSingleton('eav/config')->getAttribute('catalog_product','attribute_code')->setData('frontend_label',array('New frontend label for Store 0','New frontend label for Store 1')->save()
$labels = array();
$labels[0] = 'Age';//default store label
$labels[1] = 'Label for store with id 1';
$oAttribute = Mage::getSingleton('eav/config')->getAttribute('customer', 'age');
$oAttribute->setData('store_labels', $labels);
$oAttribute->save();