简体   繁体   English

尝试在magento中创建新产品类型,出现致命错误

[英]Trying to create new product type in magento, getting fatal error

I'm trying to create new product type in magento and it is showing up in admin panel create new product page's product type options, but when I select it and continue, i get fatal error: 我正在尝试在magento中创建新产品类型,并且它显示在管理面板中,创建新产品页面的产品类型选项,但是当我选择它并继续时,出现致命错误:

Fatal error: Call to a member function setConfig() on a non-object in /home/shop/public_html/shop/app/code/core/Mage/Catalog/Model/Product/Type.php on line 82 致命错误:在第82行的/home/shop/public_html/shop/app/code/core/Mage/Catalog/Model/Product/Type.php中的非对象上调用成员函数setConfig()

Line 82 is: 第82行是:

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

Module config file (app/code/local/Pood/Toodep6hi/etc/config.xml): 模块配置文件(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: 应用/代码/本地/ Pood /型号/产品/类型/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;
    }
}

I found a sililar problem: http://www.magentocommerce.com/boards/viewthread/196886/#t248371 , but it did not help. 我发现了一个类似的问题: http : //www.magentocommerce.com/boards/viewthread/196886/#t248371 ,但是它没有帮助。

Every bit of help would be very appreciated. 每一点帮助将不胜感激。 Thank you! 谢谢!

the problem is case sensititve 问题是区分大小写的

<model>Toodep6hi/product_type_p6hitoode</model>

it should be 它应该是

<model>toodep6hi/product_type_p6hitoode</model>

尝试从Mage_Catalog_Model_Product_Type_Virtual扩展Mage_Catalog_Model_Toodep6hi_Type_Abstract

Use lower case here: 在此使用小写字母:

<model>Toodep6hi/Product_Type_P6hitoode</model>

so it will be: 因此它将是:

<model>Toodep6hi/product_type_p6hitoode</model>

If will not help, try to use lower case for model: 如果没有帮助,请尝试对模型使用小写字母:

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

and lower case here then 然后在这里小写

<model>toodep6hi/product_type_p6hitoode</model>

Try this 尝试这个

                <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>   

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM