0

我正在尝试在 magento 中创建新产品类型,它显示在管理面板中创建新产品页面的产品类型选项,但是当我选择它并继续时,出现致命错误:

致命错误:在第 82 行的 /home/shop/public_html/shop/app/code/core/Mage/Catalog/Model/Product/Type.php 中的非对象上调用成员函数 setConfig()

第 82 行是:

$typeModel->setConfig($types[$typeId]);

模块配置文件(app/code/local/Pood/Toodep6hi/etc/config.xml):

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

        <modules>
            <Pood_Toodep6hi>
                <version>0.1.0</version>
            </Pood_Toodep6hi>
        </modules>
        <adminhtml>
            <translate>
                <modules>
                    <Pood_Toodep6hi>
                    <files>
                        <default>Pood_Toodep6hi.csv</default>
                    </files>
                    </Pood_Toodep6hi>
                </modules>
            </translate>
        </adminhtml>


        <global>

            <models>
                <Toodep6hi>
                    <class>Pood_Toodep6hi_Model</class>
                </Toodep6hi>
            </models>

            <catalog>
                <product>
                    <type>
                        <p6hitoode translate="label" module="Toodep6hi">
                            <label>Pohitoode</label>
                            <model>Toodep6hi/Product_Type_P6hitoode</model>
                            <price_model>Toodep6hi/Product_Price</price_model>
                            <index_data_retreiver>Toodep6hi/catalogIndex_Data_P6hitoode</index_data_retreiver>
                            <is_qty>1</is_qty>
                        </p6hitoode>
                    </type>
                </product>
            </catalog>



            <helpers>
                <Toodep6hi>
                    <class>Pood_Toodep6hi_Helper</class>
                </Toodep6hi>
            </helpers>
        </global>
    </config>

app/code/local/Pood/Model/Product/Type/P6hitoode.php:

<?php
class Pood_Toodep6hi_Model_Product_Type_P6hitoode extends Mage_Catalog_Model_Toodep6hi_Type_Abstract
{
        const TYPE_P6HITOODE = "p6hitoode";
    public function isVirtual()
    {
        return true;
    }
}

我发现了一个类似的问题: http: //www.magentocommerce.com/boards/viewthread/196886/#t248371,但没有帮助。

每一点帮助将不胜感激。谢谢!

4

4 回答 4

2

问题是区分大小写的

<model>Toodep6hi/product_type_p6hitoode</model>

它应该是

<model>toodep6hi/product_type_p6hitoode</model>
于 2013-08-02T04:52:09.903 回答
0

尝试从 Mage_Catalog_Model_Product_Type_Virtual 扩展 Mage_Catalog_Model_Toodep6hi_Type_Abstract

于 2013-01-15T11:51:13.390 回答
0

在这里使用小写:

<model>Toodep6hi/Product_Type_P6hitoode</model>

所以它将是:

<model>Toodep6hi/product_type_p6hitoode</model>

如果没有帮助,请尝试对模型使用小写:

<models>
    <toodep6hi>
        <class>Pood_Toodep6hi_Model</class>
    </toodep6hi>
</models>

然后在这里小写

<model>toodep6hi/product_type_p6hitoode</model>
于 2013-01-15T13:14:43.753 回答
0

尝试这个

                <type>
                    <p6hitoode translate="label" module="Toodep6hi">
                        <label>Pohitoode</label>
                        <model>Toodep6hi/product_type_p6hitoode</model>
                        <price_model>Toodep6hi/product_price</price_model>
                        <index_data_retreiver>Toodep6hi/catalogIndex_data_p6hitoode</index_data_retreiver>
                        <is_qty>1</is_qty>
                    </p6hitoode>
                </type>   
于 2014-10-28T00:24:26.577 回答