1

i have module in my magento

1: config.xml code of config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <global>
        <helpers>
            <catalog>
                <rewrite>
                    <product_view>Inic_Catalog_Helper_Product_View</product_view>
                </rewrite>
            </catalog>
        </helpers>
        <blocks>
            <catalog>
                <rewrite>
                    <product_view_attributes>Inic_Catalog_Block_Product_View_Attributes</product_view_attributes>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

2:view.php community\Inic\Catalog\Helper\Product\view.php

code of view.php

class Inic_Catalog_Helper_Product_View extends Mage_Catalog_Helper_Product_View
{
    public function gevalnow($param)
    {
      return $param
    }
}

now i have written custom code in my root folder say test.php

<?php
require_once('app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$helper = Mage::helper('inic_catalog/product_view')->gevalnow('Standard');
print_r($helper);// get value from function in view.php

i get below error:

Fatal error: Class 'Mage_Inic_Catalog_Helper_Product_View' not found in /home/keviainc/public_html/app/Mage.php on line 546

how can i do it pls guide ??..

1 Answer 1

2

You have to see what is the tag for the helper in app/code/community/Inic/Catalog/etc/config.xml. Search for <helpers>. Most probably it is:

    <helpers>
        <inic_catalog>
            <class>Inic_Catalog_Helper</class>
        </inic_catalog>
    </helpers>

then you have to use:

Mage::helper('inic_catalog/product_view')->gevalnow();

You have to replace inic_catalog with the string from the config.xml (below <helpers> tag).

4
  • not working check my updated code Commented Nov 23, 2014 at 20:33
  • Please paste the config.xml.
    – michael
    Commented Nov 23, 2014 at 20:40
  • paste config.xml see point 1: config.xml code of config.xml: Commented Nov 23, 2014 at 20:41
  • Please try with Mage::helper('catalog/product_view')->gevalnow();
    – michael
    Commented Nov 23, 2014 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.