Question

I have modified following files in Magento

app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php
app/code/core/Mage/CatalogSearch/Model/Advanced.php

Please suggest me how to overwrite the core files of magento. I have already created a module named 'Custom' for another purpose. So to overwrite the catalogsearch folder first i copied the Form.php file into my own module’s(custom) Block folder and created same structure as magento does. I have renamed the class name and it extended Mage_CatalogSearch_Block_Advanced_Form. I also added the following code in config.xml file inside my module/etc folder.

<global>
 <blocks>
            <custom>
                <class>Company_Custom_Block</class>
            </custom>

            <advanced>
                <rewrite>
                    <form>Company_Custom_Block_Advanced_Form</form>
                </rewrite>
            </advanced>
        </blocks>
</global>

But it didn't work for me. Please suggest me the needful.Thanks!

Was it helpful?

Solution

You can overwrite your file in local as following.

app/code/local/Mage/CatalogSearch/Block/Advanced/Form.php
app/code/local/Mage/CatalogSearch/Model/Advanced.php

Thanks,

OTHER TIPS

I have created a new folder called Mage inside local and copied catalogserch (app/code/core/Mage/CatalogSearch) folder and pasted it in inside Mage (app/code/local/Mage/) and it works. Gone through http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/how_to_create_a_local_copy_of_app_code_core_mage

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top