まず、 をsetData()関数でテストし、正しい属性名を使用していることを検証します。
$customer->setData('profession', 'some profession');er code here
次に、 この属性はどのように作成しましたか?私はこのようにそれを行うことをお勧めします (中/インストールファイル.PHPのアップグレード):
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
$entityTypeId = $setup->getEntityTypeId('customer');
$attributeSetId = $setup->getDefaultAttributeSetId($entityTypeId);
$attributeGroupId = $setup->getDefaultAttributeGroupId($entityTypeId, $attributeSetId);
//drop attribute if it already exists (to avoid problems)
$setup->removeAttribute('customer', 'profession');
//now recreate the attribute
$this->addAttribute('customer', 'profession', array(
'type' => 'varchar',
'input' => 'text',
'label' => Mage::helper('core')->__("Customer profession"),
'global' => 1,
'visible' => 1,
'required' => 0,
'user_defined' => 1,
'visible_on_front' => 1));
//adding the attribute in backend Forms in case you want that
Mage::getSingleton('eav/config')
->getAttribute('customer', 'profession')
->setData('used_in_forms', array('adminhtml_customer', 'customer_edit'))
->save();
は、それはあなたのために今働くなら、私に教えてください。