1

below is my config files code.

app/code/local/Eventprice/Meta/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Eventprice_Meta>
            <version>0.0.1</version>
        </Eventprice_Meta>
    </modules>
    <global>
        <models>
            <eventprice_meta>
                <class>Eventprice_Meta_Model</class>
            </eventprice_meta>
        </models>
        <resources>
            <eventprice_sql>
                <setup>
                    <module>Eventprice_Meta</module>
                </setup>
            </eventprice_sql>
        </resources>
    </global>
    <adminhtml> 
        <rewrite>
            <catalog_product_edit_tab_options_type_select>
                Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select
            </catalog_product_edit_tab_options_type_select>
            <catalog_product_edit_tab_options_option>
                Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_option
            </catalog_product_edit_tab_options_option>
        </rewrite>
    </adminhtml>
</config>

below the code of my Select.php file.

app/code/local/Eventprice/Meta/Block/Adminhtml/Catalog/Product/Edit/Tab/Options/Type/Select.php

<?php

class Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select 
extends
Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Abstract
        {
            /**
             * Class constructor
             */
             public function __construct()
            {
                parent::__construct();
                echo 'dsfdsfsd';exit;
                $this->setTemplate('sphere/catalog/product/edit/options/type/select.phtml');
                $this->setCanEditPrice(true);
                $this->setCanReadPrice(true);
            }
        }
 ?>

but my module Select.php file is not called. please help where i create a mistake Thanks.

1 Answer 1

2

you have to write rewrite code of block under the block tag like below

<global>
    [.....]
    <blocks>
        <eventprice_meta>
            <class>Eventprice_Meta_Block</class>
        </eventprice_meta>
        <adminhtml> 
            <rewrite>
                <catalog_product_edit_tab_options_type_select>
                    Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select
                </catalog_product_edit_tab_options_type_select>
                <catalog_product_edit_tab_options_option>
                    Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_option
                </catalog_product_edit_tab_options_option>
            </rewrite>
        </adminhtml>
    </blocks>
</global>

add try changing

class Eventprice_Meta_Block_Adminhtml_Catalog_Product_Edit_Tab_Options_Type_Select extends Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Type_Select

Note:- For more information on overriding magento core blocks in magento refer http://magento-online-tutorials.blogspot.in/2015/10/how-to-override-mageadminhtmlblockcatal.html

12
  • Hi Pradeep i added your code but not working Select.php file is not called fomr my module thanks. May 27, 2015 at 11:28
  • see my updated answer May 27, 2015 at 11:31
  • your extends class name is wrong May 27, 2015 at 11:31
  • i changed my class name but then after not working Thanks May 27, 2015 at 11:33
  • have you added <blocks> code in under <global tag> ? May 27, 2015 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.