How to override core model in magento ?

, , No Comments
For example :

We need to override category.php model file of the catalog module

  • Catalog module is placed in the core/Mage directory. Now here override the model file of the category.php
  • Create the following directory and files in local direcoty
    • app/code/local/Mage
    • app/code/local/Mage/Catalog
    • app/code/local/Mage/Catalog/Model
    • app/code/local/Mage/Catalog/Model/category.php
  • Now Open category.php file from this path ( core/Mage/Catalog/Model/ )
  • Copy the content of this file
  • paste copied content in new category file that is placed in this file path( local/Mage/Catalog/Model )
  • Now you can add new action or edit existing action in this model file.

0 comments:

Post a Comment