I want to add select yes/no attribute through module. I found this code from somewhere and tried but cannot add the attribute.

 $installer = $this;
        'group' => 'General Information',
        'input' => 'select',
        'type' => 'int',
        'source' => 'eav/entity_attribute_source_boolean',
        'label' => 'My Custom Attribute',
        'required' => 0,
        'unique' => 0,
        'sort_order' => 3,
        'user_defined' => 1,
        'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,

I added this code on location /var/www/html/magento/app/code/local/Test/User/sql, where Test is my package name and User is my module name. I save the above code by the name


The given below is my config file:

<?xml version="1.0"?>
        <layout>  <!-- New Section Added -->
                    <file>user.xml</file> <!-- This is name of the layout file for this module -->

   <!--Added for database-->
            <class>Test_User_Model</class> <!-- Location of all model class files -->
            <resourceModel>user_mysql4</resourceModel> <!-- Location of resource model -->
                    <table>user</table>  <!-- Actual table name in sql  -->
    <resources>  <!-- These are resource setting giving access to module, read/write permission on database -->

  • Exactly Where U need To show the attribute @Briju Commented Mar 27, 2017 at 10:23
  • I want to show it in add products, when I click on add product and then on general tab, I want to show that attribute, with value yes/no @Pranay K
    – Birju
    Commented Mar 27, 2017 at 10:33

1 Answer 1


change folder name User to user_setup





because in configuration you mention <user_setup> also remove the entry for user_setup in core_resource table

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.