2

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!

  • 2
    This question appears to be off-topic because it is about Tutoring a Software Product named Magento. – hakre Jun 29 '13 at 7:34
  • @hakre but why it is off-topic i didn't understand. Any way thanks and by the way my problem is resolved i just copied catalogserch folder and pasted it in my local folder inside Mage (created folder inside local). – monojit Jun 29 '13 at 8:10
2

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,

| improve this answer | |
1

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

| improve this answer | |

Your Answer

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