Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 07:31:41 AM

Pages: [1]   Go Down
  Print  
Author Topic: How to rewrite blocks?  (Read 1760 times)
AndrewJohn26
Trekkie
**
Offline Offline

Posts: 14


« on: April 21, 2011, 06:12:58 AM »

Hey can any one help me How to rewrite blocks in magento ? Help
Logged
mtthwsmith8
Newbie
*
Offline Offline

Posts: 5


WWW
« Reply #1 on: April 30, 2011, 04:49:13 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

}
?>
Logged

Pages: [1]   Go Up
  Print  
 
Jump to: