1. Create mymodulepack folder in local folder.
Path: C:\wamp\www\triangeli\app\code\local\mymodulepack
2. Create catalog folder inside mymodulpack namespace.
3. Create block, etc, helper folder inside Catalog folder.
4. Create Navigation.php file in block folder. Override class and write functions inside this file.
<?php
class mymodulepack_Catalog_Block_Navigation extends Mage_Catalog_Block_Navigation
{
//write the function here,which add new functionality or override the original code
public function override()
{
//write the code here
}
}
5. Create config.xml file inside etc folder.
<?xml version="1.0" encoding="iso-8859-1"?>
<config>
<modules>
<mymodulepack_Catalog>
<version>0.1.0</version>
</mymodulepack_Catalog>
</modules>
<global>
<blocks>
<catalog>
<rewrite>
<class>mymodulepack_Catalog_Block</class>
</rewrite>
</catalog>
</blocks>
<helpers>
<catalog>
<rewrite>
<class>mymodulepack_Catalog_Helper</class>
</rewrite>
</catalog>
</helpers>
</global>
</config>
6. Create Data.php file inside Helper folder.
<?php
class mymodulepack_Catalog_Helper_Data extends Mage_Core_Helper_Abstract
{
}
?>
7. To “activate” my new module “mymodulepack”:
In the file app\etc\local.xml reference mymodulepack under the global scope:
<config>
<global>
<blocks>
<catalog>
<rewrite>
<navigation>mymodulepack_Catalog_Block_Navigation</navigation>
</rewrite>
</catalog>
</blocks>
<install>
<date><![CDATA[Thu, 17 Dec 2009 11:50:52 +0000]]></date>
</install>
<crypt>
<key><![CDATA[d89edae607842ce91b0e36456faed63e]]></key>
</crypt>
<disable_local_modules>false</disable_local_modules>
<resources>
<db>
<table_prefix><![CDATA[]]></table_prefix>
</db>
<default_setup>
<connection>
<host><![CDATA[localhost]]></host>
<username><![CDATA[root]]></username>
<password><![CDATA[]]></password>
<dbname><![CDATA[pizzaman]]></dbname>
<active>1</active>
</connection>
</default_setup>
</resources>
<session_save><![CDATA[files]]></session_save>
</global>
<admin>
<routers>
<adminhtml>
<args>
<frontName><![CDATA[admin]]></frontName>
</args>
</adminhtml>
</routers>
</admin>
</config>
8. Disable cache from admin section.
Ads
Friday, July 16, 2010
Magento's logging (Debugging)
The output of Logs written to the
You can enable logging in the Magento admin panel as,
System -> Configuration - > Developer -> Log Settings and setting 'Enabled' to True.
eg. Mage :: log("I am inside the function");
Mage::log Access the system logger
Mage::getModel Access a system model object
Mage::getStoreConfig Access the system configuration settings
var/log/system.log
file, which also includes the rest of the system logging output. Logging must be enabled for output to be written to this file. You can enable logging in the Magento admin panel as,
System -> Configuration - > Developer -> Log Settings and setting 'Enabled' to True.
eg. Mage :: log("I am inside the function");
Mage::log Access the system logger
Mage::getModel Access a system model object
Mage::getStoreConfig Access the system configuration settings
Thursday, July 8, 2010
Resources for Further Reading :
1. http://techportal.ibuildings.com/2010/06/01/web-services-for-php-developers/
2. http://www.99tutes.com/
3. http://www.magentocommerce.com/wiki/doc/webservices-api/api
4. http://inchoo.net/
5. http://classyllama.com/development/magento-development/enable-templateblock-hints-in-admin-panel/
6. http://www.spinonesolutions.com/2009/09/magento-custom-module-part-i/
2. http://www.99tutes.com/
3. http://www.magentocommerce.com/wiki/doc/webservices-api/api
4. http://inchoo.net/
5. http://classyllama.com/development/magento-development/enable-templateblock-hints-in-admin-panel/
6. http://www.spinonesolutions.com/2009/09/magento-custom-module-part-i/
Subscribe to:
Posts (Atom)