2012-09-19 143 views
1

我需要使用安裝腳本在數據庫中添加一個名爲Videos的屬性組。 這些都是我的文件: 應用程序/代碼/本地/公司/ ProductVideo的/ etc/config.xml中 magento 1.7添加屬性組

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

</global> 

應用程序/代碼/本地/公司/ ProductVideo /型號/實體/ Setup.php

<?php 
class Company_ProductVideo_Model_Entity_Setup extends Mage_Eav_Model_Entity_Setup{ 
} 
?> 

應用程序/代碼/本地/公司/ SQL/attributegroup_setup/msql4安裝-1.7.0.php

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

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

?> 

我的模塊也被登記在應用程序/代碼的/ etc /模塊/ Company_ProductVideo.xml

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

但是,這是行不通的,任何幫助是值得歡迎的!

回答

0

我已經解決了它,問題是sql文件夾下的文件夾的名稱。

約定是這樣命名的:mysql4-install-'version'。