を使用してカスタム属性を追加しました
$setup->addAttribute('customer','default_business',array(
'type' => 'int',
'label' => 'Default Business Address',
'input' => 'text',
'backend' => 'orancustomer/customer_attribute_backend_business',
'required' => false,
'sort_order' => 200,
'visible' => 0,
'global' =>1,
'user_defined' => 1,));
$attr = $eavConfig->getAttribute('customer', 'default_business');
$attr->setData( 'used_in_forms', array('customer_account_create', 'customer_account_edit', 'checkout_register')///*'adminhtml_customer',*/
)->save();
期待通りに動作しました。しかし、私がそれを削除しようとしたとき、
$installer->removeAttribute('customer', 'default_business');
eav_attributeテーブルからsucessfulluが削除されました。しかし、管理セクションで次のエラーが発生します致命的なエラー:D:\ xampp \ htdocs \ magoran \ app \ code \ core \ Mage \ Eav \ Model \ Entityの非オブジェクトでメンバー関数getBackend()を呼び出す515行目の\Collection\ Abstract.php
そして、デバッグしようとすると、まだdefault_business属性を検索していることがわかりました。顧客の管理ページで属性を検索中です。これがデバッグ中に見つけたクエリです
SELECT `eav_attribute`.* FROM `eav_attribute` WHERE (`eav_attribute`.`attribute_code`='oran_company') AND (entity_type_id = :entity_type_id)
BIND: array (
':entity_type_id' => '1',
)