Thursday, May 16, 2013

Adding new model for existing or core module in magento

if you add new model for existing module you have to follow below code
that if you extend one core module ex catalog,checkout etc.. and you need to add new model then follow below steps
extending catalog module to local folder
1. add resource in config.xml that is

i extend catalog module and added newmodel as new model
2. create a table tablename_new manually in Db
3. create a model files that is local\Catalog\Model\Newmodel.php local\Catalog\Model\Resource\Newmodel.php local\Catalog\Model\Resource\Newmodel\Collection.php
please check attached files in this post
now you can call
$obj=Mage::getModel(’sugarcode_catalog/newmodel’)->getCollection(); print_r($obj);

No comments:

Post a Comment