Search code examples
entity-attribute-valuemagento-1.7

magento 1.7 add attributegroup


I need to add an attributegroup called Videos in the database using an install script. these are my files: app/code/local/Company/ProductVideo/etc/config.xml

    <resources>
        <attributegroup_setup>
            <setup>
                <module>Company_ProductVideo</module>
                <class>Company_ProductVideo_Model_Entity_Setup</class>
            </setup>
        </attributegroup_setup>
    </resources>

</global>

app/code/local/Company/ProductVideo/Model/Entity/Setup.php

<?php
class Company_ProductVideo_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup{
}
?>

app/code/local/Company/sql/attributegroup_setup/msql4-install-1.7.0.php

<?php
$installer = $this;
$installer->startSetup();

$installer->addAttributeGroup('catalog_product', 'Default','Videos', 40);
$installer->endSetup();

?>

My module is also registered in app/code/etc/modules/Company_ProductVideo.xml

<config>
  <modules>
    <Company_ProductVideo>
        <active>true</active>
        <codePool>local</codePool>
     </Company_ProductVideo>
   </modules>
</config>

But this is not working, any help is welcome!!


Solution

  • I have already solved it, the problem was the name of the folder under the sql folder.

    the convention is to name it like this: mysql4-install-'version'.