1

I am trying to override the block Mage_Customer_Form_Register

I have written this in my config.xml

<blocks>
        <registration>
            <class>Neo_Registration_Block</class>
        </registration>
        <customer>
            <rewrite>
                <form_register>Neo_Registration_Block_Form_Register</form_register>
            </rewrite>
        </customer>
    </blocks>

And this is not working as the methods I wrote in my local overriden block are not getting called.

And as the register.phtml is written in Persistent module,

So now how I can override this block ?

0

Use below code:

config.xml file as below

<?xml version="1.0"?>
<config>
    <modules>
        <MyWeb_Brand>
            <version>0.1.0</version>
        </MyWeb_Brand>
    </modules>    
    <frontend>
        <routers>
            <MyWeb_Brand_Route>
                <use>standard</use>
                <args>
                    <module>MyWeb_Brand</module>
                    <frontName>brand</frontName>
                </args>
            </MyWeb_Brand_Route>
        </routers>
    </frontend>
    <global>
        <blocks>
            <brand>
                <class>MyWeb_Brand_Block</class>
            </brand>
            <customer>
                <rewrite>
                    <form_register>MyWeb_Brand_Block_Form_Register</form_register>
                </rewrite>
            </customer>
        </blocks>
    </global>
</config>

Your block file Register.php file at app/code/MyWeb/Brand/Block/Form/Register.php

add below code to it

<?php

class MyWeb_Brand_Block_Form_Register extends Mage_Customer_Block_Form_Register
{
}

Note: Change module name as per your module

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.