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

“Mage” folder under /app/code/local/
 
Johanna
Jr. Member
 
Total Posts:  7
Joined:  2007-11-28
 

Hello,

I have a question on folder naming convention.

As it is now, under /app/code/local/ I have created my own folder that is NOT called “Mage”.

However, when I add a field to the core_config_field table and give the source model a value of myadminhtml/system_config_source_tax_model, I get an error saying it cannot find Mage\myadminhtml\Model\System\Config\Source\Tax\Model.php

If I rename my local folder to “Mage” it works fine.

Would you recommend using “Mage” as folder name, and if so what are the reasons? Or should any folder name work?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

please paste config.xml for your module, especially declaration of the model

 
Magento Community Magento Community
Magento Community
Magento Community
 
Johanna
Jr. Member
 
Total Posts:  7
Joined:  2007-11-28
 

Here it is

<models>
    <
myadminthml>
        <class>
My_MyAdminhtml_Model_System_Config_Source_Tax_Model</class>
    </
myadminthml>
</
models>
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

And in app/code/local/My/MyAdminhtml/Model/System/Config/Source/Tax/Model.php your class line reads:

class My_MyAdminhtml_Model_System_Config_Source_Tax_Model ...
?
 
Magento Community Magento Community
Magento Community
Magento Community
 
Johanna
Jr. Member
 
Total Posts:  7
Joined:  2007-11-28
 

At the moment it looks like this;

<?php

class My_MyAdminhtml_Model_System_Config_Source_Tax_Model
{
    
protected $_options;
    
    public function 
toOptionArray($isMultiselect)
    
{
         
if (!$this->_options{
                       $this
->_options = array('1'=>'Net''2'=>'Gross');
        
}
        
        $options 
$this->_options;
        
        return 
$options;
    
}
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Johanna
Jr. Member
 
Total Posts:  7
Joined:  2007-11-28
 

I found a typo in my config.xml that I’ve corrected but unfortunately didn’t solve my problem, instead it leads to the error message saying that it cannot find the file My\MyAdminhtml\Model\System\Config\Source\Tax\Model\System\Config\Source\Tax\Model.php

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