I am trying to extend the core helper class But found the below error..
Fatal error: Class 'Mage_Kishore_Kp_Helper_Data' not found
Below are the path of my files..
1. app/etc/modules/Kishore_Kp.xml
2. app/code/community/Kishore/Kp/etc/config.xml
3. app/code/community/Kishore/Kp/Helper/Data.php
These are my files..
1.Kishore_Kp.xml
<?xml version="1.0"?>
<config>
<modules>
<Kishore_Kp>
<active>true</active>
<codePool>community</codePool>
<depends>
<Mage_Core/>
<Mage_Catalog/>
</depends>
</Kishore_Kp>
</modules>
</config>
2. config.xml
<?xml version="1.0" encoding="UTF-8"?>
<config>
<modules>
<Kishore_Kp>
<version>1.0.0</version>
</Kishore_Kp>
</modules>
<global>
<helpers>
<kishore_kp>
<class>Kishore_Kp_Helper</class>
</kishore_kp>
</helpers>
</global>
<frontend>
<routers>
<kishore_kp>
<use>standard</use>
<args>
<module>Kishore_Kp</module>
<frontName>kpswitcher</frontName>
</args>
</kishore_kp>
</routers>
</frontend>
</config>
3.Data.php
<?php
class Kishore_Kp_Helper_Data extends Mage_Core_Helper_Abstract
{
const FULL_SITE_COOKIE = 'USE_FULL_SITE';
public function getMobileToDesktopUrl() {
echo "helllllo";exit;
}
}
I am calling this helper in the footer.phtml as..
<a href="<?php echo Mage::helper('kishore_kp')->getMobileToDesktopUrl() ?>">View</a>
can any one says what am I doing wrong ?
These are the only files related to the module.I have given all the files here.
So can any one find some error in this code, please inform..
Thanks.
Best Answer
Follow bellow steps:
Step : 1 Create config.xml file at location
Step : 2 Create Data.php file at location
Step : 3 Create SwitchController.php file at location
Step : 4 Create Package.php file at location
Step : 5 Create AR_Themeswitcher.xml file at location
Step : 6 Called helper in the
footer.phtml