Is there any clean way to add custom field to all product attributes in Magento?
Catalog -> Attributes -> Manage Attributes -> (Add new/Edit) Attribute page.
Something like it can be done for catalog category:
$setup = new Mage_Eav_Model_Entity_Setup("core_setup");
// below code will add text attribute
$setup->addAttribute("catalog_category", "attribute_code", array(
"group" => "General",
"input" => "text",
"type" => "varchar",
"label" => "Attribute label",
"backend" => "",
"visible" => 1,
"required" => 0,
"user_defined" => 1,
"global" => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
));
There is no record in eav_entity_type table for attributes, so i can not use this method. Is there any suggestion on the best way for adding this custom field for attributes.
addAttribute('eav_attribute' ...)` – Alex Jul 31 '13 at 09:25