2
votes

I am trying to create a new Product Type. But I am always getting an error, that the Helper Method could not be found. Why is Magento searching the Method in the Mage Namespace and not in the Xcrypt?

The cache is disabled and I flushed the Magento Cache and the Cache Storage...

ERR (3): Warning: include(): Failed opening 'Mage/Android/Helper/Data.php' for inclusion
         (include_path='/var/www/URL/app/code/local:
                        /var/www/URL/app/code/community:
                        /var/www/URL/app/code/core:
                        /var/www/URL/lib:
                        .:
                        /usr/share/php:/usr/share/pear')  in 
        /var/www/URL/lib/Varien/Autoload.php on line 93

files and directory structure

app/code/local/Xcrypt/Android$ ls  -R

./etc:
config.xml

./Helper:
Data.php

./Model/Product/Type:
App.php

config.xml

<?xml version="1.0"?>
<config>

  <modules>
    <Xcrypt_Android>
      <version>0.1.0</version>
    </Xcrypt_Android>
  </modules>

  <adminhtml>
      <translate> 
        <modules>     
          <Xcrypt_Android>  
            <files>     
              <default>Xcrypt_Android.csv</default>
            </files>    
          </Xcrypt_Android>   
        </modules>    
      </translate>
  </adminhtml>

  <global>

    <models>
      <android>   
        <class>Xcrypt_Android_Model</class>
      </android>  
    </models>

    <catalog>
        <product>     
          <type>        
            <android translate="label" module="Android">
              <label>Android Product Type</label>
              <model>android/product_type_app</model>
            </android>        
          </type>       
        </product>    
    </catalog>

    <helpers>
      <android>   
        <class>Xcrypt_Android_Helper</class>
      </android>  
    </helpers>

  </global>

</config>

Helper/Data.php

<?php
class Xcrypt_Android_Helper_Data extends Mage_Core_Helper_Abstract {
}
?>

Model/Product/Type/App.php

<?php
class Xcrypt_Android_Model_Product_Type_App extends Mage_Catalog_Model_Product_Type_Abstract {
}
?>

app/etc/modules/Xcrypt_Android.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Xcrypt_Android>
            <active>true</active>
            <codePool>local</codePool>
        </Xcrypt_Android>
    </modules>
</config>
1

1 Answers

3
votes

I found the problem... I was just a problem with the case! The module name must be lower case:

        <android translate="label" module="android">

For further explaination see the comment of Ben ... thanks!