How can you create your new attribute and place it in the Default attribute set and at the same time in your own new group?

I do it this way (at first I just want to put in Default in any group):

 <?php /** @var Mage_Eav_Model_Entity_Setup $this*/ $installer = $this; $installer->startSetup(); $data= array ( 'attribute_set' => 'Default', 'group' => 'General', 'label' => 'New Attr', 'visible' => true, 'type' => 'int', // multiselect uses comma-sep storage 'input' => 'boolean', 'system' => false, 'required' => false, 'user_defined' => true,//defaults to false; if true, define a group 'source' => 'eav/entity_attribute_source_boolean', 'default' => 1, 'global' => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE, ); $entityTypeId = Mage::getModel('catalog/product')->getResource()->getTypeId(); $attributeSetId = Mage::getModel('catalog/product')->getDefaultAttributeSetId(); $installer->addAttributeToSet($entityTypeId, $attributeSetId, 'General', 'new_attr', 10); $installer->endSetup(); 

What am I doing wrong ?

When I reload the page it just does not load - it gives out

Project.dev page not working

And at the same time my setup not recorded in the core_resource table!

Tell me how to do it right? Or where did I make a mistake?

  • what in error logs? - Naumov
  • @Naumov, the problem is that in var / report / it doesn’t throw anything and in var / log / it’s also dicky! - Maybe_V
  • What kind of server include all the errors? is the cache disabled? - Naumov
  • @Naumov, Apache2 server, cache disabled! And in the most magento included logs - Maybe_V
  • show the config.xml and specify the paths to the files, maybe the error is that magento doesn’t work until the install script / - Naumov

0