I’m trying to set a source_model on a custom module in Magento.
module is in local/Bitstream/Selfawb
in system.xml I have this:
<email_type translate="label">
<label>Email Type</label>
<frontend_type>multiselect</frontend_type>
<source_model>bitstream/source_emailType</source_model>
<sort_order>3</sort_order>
<show_in_default>1</show_in_default>
<show_in_website>1</show_in_website>
<show_in_store>1</show_in_store>
</email_type>
And EmailType.php is in /local/Bitstream/Selfawb/Model/EmailType.php with the folowing code:
class Bitstream_Selfawb_Model_Source_EmailType{
public function toOptionArray(){
return array(
array('value'=>'mobile', 'label'=>Mage::helper('mailchimp')->__('MOBILE')),
);
}
}
The problem is I get this error in browser: Fatal error: Call to a member function toOptionArray() on a non-object
What am I doing wrong here?
The answer is the path
/local/Bitstream/Selfawb/Model/EmailType.phpshould have a “Source” in it./local/Bitstream/Selfawb/Model/Source/EmailType.php