Max
Max

Reputation: 117

add new system attribute in magento

I want to add a new attribute named 'category' as system attribute which will be available in all attribute set.Can anybody help me...please give me solution how to do this...thanks

Upvotes: 3

Views: 7907

Answers (2)

Mukesh Chapagain
Mukesh Chapagain

Reputation: 25958

You can do it by mysql setup file of your custom module. Here is the link of an article which has the code to add attribute:-

Magento: Adding attribute from MySql setup file

In the above link article, you will see

'user_defined' => true,

For creating system attribute, you have to make it

'user_defined' => false,

Thanks.

Upvotes: 13

macki
macki

Reputation: 365

As far as i know the only way to add a system attribute is to do it through database call. You will need to write extension that includes setup installation script for SQL (see any core extension for examples) and use addAttribute method.

Upvotes: 0

Related Questions