View Full Version : How to rewrite blocks?
AndrewJohn26
Apr 22nd, 2011, 02:51 AM
Hey can any one help me How to rewrite blocks in magento ?
mtthwsmith8
May 5th, 2011, 12:42 AM
For this you need to create following files as explained in the following example:
Example:
Company name: Coreover
Module Name: Catalog
File path: app\code\local\Coreover\Catalog\etc\config.xml
Config.xml file:
<?xml version="1.0"?>
<config>
.............
<global>
<blocks>
<catalog>
<rewrite>
<product_list_toolbar>Coreover_Catalog_Block_Product_List_Toolbar</product_list_toolbar>
</rewrite>
</catalog>
</blocks>
..............
</global>
............
</config>
File Path: app\code\local\Coreover\Catalog\Block\Product\List\Toolbar.php
Php file for your module :
<?php
class Coreover_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar {
//Your Code for rewriting functions
}
?>
Magento Development (http://www.magento-development.com/magento-development.php) | Magento Developer (http://www.magento-development.com/hire-magento-developer.php) | Magento Designer (http://www.magento-development.com/magento-website-design.php )
SiberForum
May 17th, 2011, 07:21 AM
The access logs are usually somewhere under /var/log/httpd (I don't remember exactly where cpanel keeps them). Once you find the log file for that domain you could download and search through it for the error code (if it's not too big) or just "grep 501 filename".
vishalchadha0
Apr 22nd, 2013, 12:46 AM
File path: app\code\local\Coreover\Catalog\etc\config.xml
Config.xml file:
<?xml version="1.0"?>
<config>
.............
<global>
<blocks>
<catalog>
<rewrite>
<product_list_toolbar>Coreover_Catalog_Block_Product_List_Toolbar</product_list_toolbar>
</rewrite>
</catalog>
</blocks>
..............
</global>
............
</config>
File Path: app\code\local\Coreover\Catalog\Block\Product\List\Toolbar.php
Php file for your module :
<?php
class Coreover_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar {
//Your Code for rewriting functions
}
?>
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.