dsfds4551 2014-02-17 22:29
浏览 54
已采纳

致命错误:第547行的/var/www/html/app/Mage.php中找不到“Mage_Ibtheme_Helper_Data”类

I’ve followed the necessary steps that would normally resolve this issue:

Magento Admin Helper_Data not found

However I keep getting similar results. I believe I have successfully instantiated the class and helper data. Could someone tell me what I'm overlooking? Also, can the system.xml file be at fault?

UPDATE: This is only happening in view.phtml (Product Detail Page) and the reference to the helper theme is what I believe is at fault:

$ibtheme = $this->helper('ibtheme');

Error:

Fatal error: Class ‘Mage_Ibtheme_Helper_Data’ not found in /var/www/html/app/Mage.php on line 547

Data.php:

    <?php

/**
 * ItemBridge Theme Default Helper
 *
 * @category    ItemBridge
 * @package     ItemBridge_Theme
 * @copyright   Copyright (c) 2012 InfoStyle (http://infostyle.com.ua)
 * @license     http://themeforest.net/licenses/regular_extended ThemeForest Regular & Extended License
 */

class ItemBridge_Theme_Helper_Data extends Mage_Core_Helper_Abstract
{
    public function getProductClasses($product)
    {
        return " " . ($this->isNewProduct($product) ? 'new-product' : '') . " " . ($this->isSaleProduct($product) ? 'sale-product' : '') . " ";
    }

    public function isNewProduct($product)
    {
        $from = $product->getData('news_from_date');
        $to = $product->getData('news_to_date');
        $now = date("Y-m-d 00:00:00");

        return ($from && $to && $now >= $from && $now <= $to) || ($from && $now >= $from) || ($to && $now <= $to);
    }

    public function isSaleProduct($product)
    {
        return number_format($product->getFinalPrice(), 2) != number_format($product->getPrice(), 2);
    }

    public function hex2rgb($hex) {
       $hex = str_replace("#", "", $hex);

       if(strlen($hex) == 3) {
          $r = hexdec(substr($hex,0,1).substr($hex,0,1));
          $g = hexdec(substr($hex,1,1).substr($hex,1,1));
          $b = hexdec(substr($hex,2,1).substr($hex,2,1));
       } else {
          $r = hexdec(substr($hex,0,2));
          $g = hexdec(substr($hex,2,2));
          $b = hexdec(substr($hex,4,2));
       }
       $rgb = array($r, $g, $b);

       return $rgb;
    }
}

config.xml:

    <?xml version="1.0"?>
<!--
 * @category    ItemBridge
 * @package     ItemBridge_Theme
 * @copyright   Copyright (c) 2012 InfoStyle (http://infostyle.com.ua)
 * @license     http://themeforest.net/licenses/regular_extended ThemeForest Regular & Extended License
-->
<config>
    <modules>
        <ItemBridge_Theme>
            <version>0.1</version>
        </ItemBridge_Theme>
    </modules>

    <global>
        <blocks>
            <ibtheme>
                <class>ItemBridge_Theme_Block</class>
            </ibtheme>
        </blocks>

        <helpers>
            <ibtheme>
                <class>ItemBridge_Theme_Helper</class>
            </ibtheme>
        </helpers>
    </global>

    <default>
        <ib_theme_design>
            <general>
                <store_color>#fdf651</store_color>
                <store_pattern>bg.png</store_pattern>
                <store_layout>standart</store_layout>
                <store_footer>white</store_footer>
                <store_productGrid>type1</store_productGrid>
                <store_OptionsPanel>no</store_OptionsPanel>
            </general>
        </ib_theme_design>
    </default>

    <adminhtml>
        <acl>
            <resources>
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <ib_theme_design>
                                            <title>ItemBridge Design</title>
                                        </ib_theme_design>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>
  • 写回答

1条回答 默认 最新

  • duan62819774 2014-02-19 06:56
    关注

    Your config.xml has some spaces at the beginning before <?xml version="1.0"?>.
    Most probably this makes it invalid and is not loaded in the full configuration of Magento.
    Remove the spaces, and make sure the xml is valid. Clear the cache when you are done.

    Small tip for the future: Always develop with error reporting and display errors on. Also setting the developer mode on could help a lot in finding these issues.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大