0
我添加使用刪除客戶form屬性
$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 \中的非對象的成員函數getBackend Entity \ Collection \ Abstract.php on line 515
而當我嘗試調試時發現它仍在搜索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',
)