Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Custom module attribute values not matching values from install file
 
jotu
Member
 
Avatar
Total Posts:  34
Joined:  2008-03-03
Switzerland
 

Hi list,

I am writing a module and have added an install file to add an attribute to the customer entity. The values I want are:

$setup->addAttribute('customer''comments', array(
        
'position'                 => 1,
        
'backend_type'          => 'text',
        
'frontend_label'        => 'Comments',
        
'is_global'             => true,
        
'is_visible'            => true,
        
'is_required'           => false,
        
'is_user_defined'       => true,
        
'is_searchable'         => false,
        
'is_filterable'         => false,
        
'is_comparable'         => false,
        
'is_visible_on_front'   => false,
        
'is_visible_in_advanced_search' => false,
        
'is_unique'             => false,
        
'is_configurable'       => false,
        
'position'              => 1,
    ));

But the resulting attribute values in the eav_attribute table are:

backend_type        varchar
frontend_label    
is_global            1
is_visible            1
is_required            1
is_user_defined        0
is_searchable        0
is_filterable        0
is_comparable        0
is_visible_on_front    0
is_unique            0
is_configurable        0
position            1

Is it normal that the results I’m getting in the eav table don’t correspond to the options I defined in the addAttribute method?
Cheers,
Simon

 
Magento Community Magento Community
Magento Community
Magento Community
 
jotu
Member
 
Avatar
Total Posts:  34
Joined:  2008-03-03
Switzerland
 

Any hints here? I’ve extended my module, i.e. added another field to the customer attributes table. I’ve set

'backend_type'          => 'int',
in the addAttribute method in my upgrade file, but again the result I get in the attributes table is backend_type = varchar. As I’m new to Magento I don’t know if this is my bad, or a bug. Any help would be greatly appreciated…
Cheers,
Simon
 
Magento Community Magento Community
Magento Community
Magento Community
 
LeeSaferite
Guru
 
Avatar
Total Posts:  322
Joined:  2007-08-31
Lake City, FL
 

Try

'type' => 'text'
 
Magento Community Magento Community
Magento Community
Magento Community
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 

I am also trying to add attributes to an existing attributeset set but no succes for me.

What value do i assign to $setup?

 
Magento Community Magento Community
Magento Community
Magento Community
 
fenixf
Member
 
Total Posts:  35
Joined:  2008-04-08
 
fenixf - 23 October 2008 07:32 AM

I am also trying to add attributes to an existing attributeset set but no succes for me.

What value do i assign to $setup?

That is: $setup = new Mage_Eav_Model_Entity_Setup(’core_setup’);

Other question: How would I update an existing attribute? let’s say I wanted to change the ‘is_filterable’ from false to true?

And how would I apply this attribute to the attributeset ‘Jeans’

And how would I add options to this attribute?

like: Green , sortorder 3,
blue with sortorder 2
and so on

Thanks,

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top