0
votes

I've created a new product type and need to create and associate some custom attributes with it.

Is there a way it can be done in the setup code?

Update: When I say setup code I mean in the "module/sql/module_setup/mysql4-install-0.1.0.php" file for when Magento first uses the module.

1
try to be more specific. setup code is a php file that is executed so in theory you can do everything there that you can do with php.Anton S

1 Answers

0
votes

This helped set me in the right direction, http://www.danneh.org/2010/03/adding-multi-select-attributes-using-an-installer-in-magento/

You also need this in your config.xml

<global>
    <resources>
        <mymodule_setup>
            <setup>
                <module>Company_Mymodule</module>
                <class>Company_Mymodule_Model_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </mymodule_setup>
    <resources>
</global>