Я не могу сохранить свои пользовательские атрибуты клиента:
Мой бэкэнд Magento заблокирован, и я получаю следующие ошибки:
2011-08-03T12:27:36+00:00 ERR (3): Warning: include(Mage\Customer\Model\Attribute\Data\.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in C:\xampp\htdocs\magento_test142_3\lib\Varien\Autoload.php on line 93
2011-08-03T12:27:36+00:00 ERR (3): Warning: include() [<a href='function.include'>function.include</a>]: Failed opening 'Mage\Customer\Model\Attribute\Data\.php' for inclusion (include_path='C:\xampp\htdocs\magento_test142_3\app\code\local;C:\xampp\htdocs\magento_test142_3\app\code\community;C:\xampp\htdocs\magento_test142_3\app\code\core;C:\xampp\htdocs\magento_test142_3\lib;.;C:\xampp\php\PEAR') in C:\xampp\htdocs\magento_test142_3\lib\Varien\Autoload.php on line 93
Это код моего модуля: в файле mysql4-install-0.1.0.php:
<?php
$installer=new Mage_Customer_Model_Entity_Setup ('core_setup');
$installer->startSetup();
$installer->addAttribute('customer', 'kd_nr', array(
'label' => 'Kundennummer',
'visible' => true,
'required' => false,
'position' => 20,
));
Mage::getSingleton( 'eav/config' )
->getAttribute( 'customer', 'kd_nr' )
->setData( 'used_in_forms', array( 'adminhtml_customer' ) )
->save();
$installer->endSetup();
и вот мой файл config.xml:
<?xml version="1.0"?>
<config>
<modules>
<Mycompany_Newattcustomer>
<version>0.1.1</version>
</Mycompany_Newattcustomer>
</modules>
<global>
<resources>
<newattcustomer_setup>
<setup>
<module>Mycompany_Newattcustomer</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</newattcustomer_setup>
</resources>
<fieldsets>
<customer_account>
<kd_nr><create>1</create><update>1</update></kd_nr>
</customer_account>
</fieldsets>
</global>
</config>
Я использую Magento 1.4.2
Пожалуйста, помогите решитьэта проблема.
Большое спасибо.
[править]
Большое спасибо за помощь, кажется, что код Насараллы работает, но я обнаружил, что моя проблема пришлаиз выбора ДА / НЕТ: Вот код для поля выбора:
$installer->addAttribute('customer', 'in_search', array(
'label' => 'Appear in search',
'type' => 'int',
'input' => 'select',
'source' => 'eav/entity_attribute_source_boolean',
'visible' => true,
'required' => false,
));
Mage::getSingleton( 'eav/config' )
->getAttribute( 'customer', 'in_search' )
->setData( 'used_in_forms', array( 'adminhtml_customer' ) )
->save();
Будет очень полезно, если кто-нибудь поможет мне решить действительно проблему
[/ edit]