A
A
Alexander Belikov2015-08-31 11:30:31
Magento
Alexander Belikov, 2015-08-31 11:30:31

How to redirect class from Block?

good day to everyone who can explain right on the fingers, I want to make changes to the module from the core bundle which, and I want to make changes to the file app/code/core/Mage/Bundle/Block/Catalog/Product/View/Type/Bundle/ /option.php
How can I make magento take a function from my file in local? for the first time I work on magento, I read a couple of articles, but everywhere there are examples on controllers, is it possible to do it the way I thought?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Den4ik_k, 2015-09-10
@Alexzzz91

There are several options, the simplest is rewriting the class.
You create your own module and add to config.xml

<blocks>
            <my_ext>
                <class>My_Ext_Block</class>
            </my_ext>
            <bundle>
                <rewrite>
                   <catalog_product_view_type_bundle_option>My_Ext_Block_Catalog_Product_View_Type_Bundle_Option</catalog_product_view_type_bundle_option>
                </rewrite>
            </bundle>
        </blocks>

You create your block, which is inherited from the core block and you can override any methods you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question