進出口戰鬥與教程: http://magento.ikantam.com/qa/custom-input-types-custom-optionsMagento的 - 不正確的塊型(自定義選項)
,我有錯誤,當我打開自定義選項標籤(產品編輯頁面): 無效塊類型: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
喜歡裏面的教程。