I am developing a small Magento-extension for grouped products. This extension needs another attribute, so I figured I could just write a setup script which adds a new attribute to grouped products. But as pretty much everything I tried to do in Magento, that turned out to be way more complex than I expected. The official Magento forum is no real help, so I hope for some support here :)
The new attribute should only appear in the "General" tab of grouped products; simple products, configurable products, bundle products etc. should stay unaltered. The attribute should be there independently of the selected attribute set, just like it was a system attribute.
To do so I thought I could just add the attribute to the entity of grouped products, but as I found out, there's no special entity for grouped products, only the entity "catalog_product" for products in general. Thus my next thought was, I needed to add the attribute to the "catalog_product" entity and then assign it to the correct attribute group, so that it only applies to grouped products.
Problem is that I am not that deep into Magento yet and I have totally no clue how I am supposed to find the corresponding attribute group or if my idea is gonna work at all, maybe I'm totally on the wrong track here :/
Just to let you know what I got so far: I registerd my setup script in the extension's config file and it is being executed, only problem is the setup script itself, it looks like the following atm, because - as I said - I have no clue yet:
$installer = $this;
$installer->startSetup();
$installer->addAttribute("catalog_product", "my_attrib_name", array( /* just a placeholder */ ));
$installer->endSetup();
Pretty basic...