簡體   English   中英

Magento-錯誤的塊類型(自定義選項)

[英]Magento - incorrect block type (custom option)

我正在與教程戰斗: http//magento.ikantam.com/qa/custom-input-types-custom-options

當我打開自定義選項選項卡(產品編輯頁面)時出現錯誤:無效的塊類型: Mage_ProductSize_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Instagramimage'

我不知道問題出在哪里; /為什么會有Mage_NAME而不是Rea_ProductSize_NAME? 我在模塊內部的完整配置(跳過事件)

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Rea_ProductSize>
            <version>0.0.1</version>
        </Rea_ProductSize>
    </modules>
    <models>
            <rea_productsize>
                <class>Rea_ProductSize_Model</class>
            </rea_productsize>
            <catalog>
               <rewrite>
                   <product_option>Rea_ProductSize_Model_Catalog_Product_Option</product_option>
               </rewrite>
            </catalog>
    </models>
    <!-- Configure our module's behavior in the global scope -->
    <global>
        <!-- Defining an event observer -->
        <events>
            <sales_quote_add_item>
                <observers>
                   <Ecophone_Specialoffer_Model_Observer>
                      <type>singleton</type>
                      <class>Rea_ProductSize_Model_Observer</class>
                      <method>changingPrice</method>
                   </Ecophone_Specialoffer_Model_Observer>
               </observers>
            </sales_quote_add_item>
            <!-- The code of the event we want to observe -->
            <checkout_cart_product_add_after>
                <observers>
                    <rea_productsize>
                        <!-- The model to be instantiated -->
                        <class>Rea_ProductSize_Model_Observer</class>
                        <!-- The method of the class to be called -->
                        <method>applyPriceBasedOnSize</method>
                        <!-- The type of class to instantiate -->
                        <type>singleton</type>
                    </rea_productsize>
                </observers>
            </checkout_cart_product_add_after>
            <checkout_cart_update_items_after>
                <observers>
                    <rea_productsize>
                        <!-- The model to be instantiated -->
                        <class>Rea_ProductSize_Model_Observer</class>
                        <!-- The method of the class to be called -->
                        <method>applyPricesBasedOnSize</method>
                        <!-- The type of class to instantiate -->
                        <type>singleton</type>
                    </rea_productsize>
                </observers>
            </checkout_cart_update_items_after>
        </events>
        <!-- CUSTOM OPTION MODULE -->
        <catalog>
            <product>
                <options>
                    <custom>
                        <groups>
                            <instagramimage translate="label" module="ProductSize">
                                <label>Instagram image</label>
                                <render>ProductSize/adminhtml_catalog_product_edit_tab_options_type_instagramimage</render> 
                                <types>
                                    <instagramimage_type translate="label" module="ProductSize">
                                        <label>Image</label>
                                    </instagramimage_type>
                                </types>
                            </instagramimage>
                        </groups>
                    </custom>
                </options>
            </product>
        </catalog>
        <blocks>
            <adminhtml>
                <rewrite>
                    <catalog_product_edit_tab_options_option>Rea_ProductSize_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Option</catalog_product_edit_tab_options_option>
                </rewrite>
            </adminhtml>
        </blocks>
        <!-- CUSTOM OPTION MODULE END -->
    </global>
</config>

有類Rea_ProductSize_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Instagramimage並像教程中一樣擴展了Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract

確定在magento論壇上找到類似的錯誤。 名稱有問題:

<render>ProductSize/adminhtml_catalog_product_edit_tab_options_type_instagramimage</render> 

所以我在塊部分添加了快捷方式:

    <rea_productsize>
        <class>Rea_ProductSize_Block</class>
    </rea_productsize>

現在

<render>rea_productsize/adminhtml_catalog_product_edit_tab_options_type_instagramimage</render> 

工作正常

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM