Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

[SOLVED] Problem running install script of a custom module in magento CE 1.7
 
marcog_dotcom
Jr. Member
 
Total Posts:  3
Joined:  2011-04-14
 

Hi to everyone,
I’m trying to run a install script for a custom module in order to add 2 custom attributes to the order.
In the config.xml I put this code

<resources>
            <
modulename_setup>
                <
setup>
                    <
module>Company_ModuleName</module>
                       <class>
Mage_Sales_Model_Mysql4_Setup</class>
                                </
setup>
                <
connection>
                    <use>
core_setup</use>
                </
connection>
            </
modulename_setup>
            <
modulename_write>
                <
connection>
                    <use>
core_write</use>
                </
connection>
            </
modulename_write>
            <
modulename_read>
                <
connection>
                    <use>
core_read</use>
                </
connection>
            </
modulename_read>
        </
resources>

then I’ve put the install script in the file sql/modulename_setup/mysql4-install-1.0.php

$installer $this;

$installer->startSetup();

$installer->addAttribute(
    
'order'
    
'first_attribute'
    array(
        
'label'                => 'First custom attribute',
        
'input'                => 'text',
        
'type' => 'text'
        
'grid' => true
        
'visible'            => true,
        
'visible_on_front'    => false,
        
'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        
'required'            => false,
        
'is_user_defined'    => true
    
)
);

$installer->addAttribute(
        
'order',
        
'second_attribute',
        array(
                
'label'                => 'Second custom attribute',
                
'input'                => 'text',
                
'type' => 'text'
                
'grid' => true
                
'visible'            => true,
                
'visible_on_front'    => false,
                
'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
                
'required'            => false,
                
'is_user_defined'    => true
        
)
);
$installer->endSetup();

I’ve performed these steps many times in Magento CE 1.6, why now do I have problems?
Thank you in advance

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jolora
Jr. Member
 
Total Posts:  5
Joined:  2010-03-01
 

I’m having a similar issue. What was your solution please?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top