How can i change the block? 

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

 

I am a novice of Magento. i would like to change my template and the block.
I know how to change it to run my template.
but how to change the block?

Image Attachments
z.jpg
 

Hi there,

The block is referencing app/code/core/Mage/Customer/Block/Widget/Name.php

Can I ask what you need to change? It’s not really advisable to change core files. If you do, make sure you replicate the folder structure and alter the files in app/code. Do you know what I mean by that?

If you can tell me what you want to change, hopefully there won’t be any need.

-Steve

 Signature 

http://www.beetleweb.com

 

Hi wilfredyan,

To change the block, you can rewrite it.
To rewrite block you can refer the below code, insert it to config.xml file of your module

</global>
        ...
        <
blocks>
            ...
            <
customer>
                <
rewrite>
                    <
widget_name>NameSpace_ModuleName_Block_Yourblock</widget_name>
                </
rewrite>
            </
customer>
            ...
        </
blocks>
        ...
    </global>

Hope this helps!

Best Regards,
Magestore.

 Signature 

Magestore - Magento Extensions and Templates: Affiliate, Store pickup, Gift-wrap, Gift voucher, 1stepcheckout, Auction…
Affiliate+ - Full-functioned Magento extension to run Affiliate program at $99

 

Thanks Steve & Magestore

You are very helpful :D
In this case, I want to make a form for customer to register account.
Because by default magento only have name, email address & password.
i want to add Address (text box), Phone number (text box) & newsletter subscribe (check box)
so I think i need to create another block to extends [Mage_Customer_Block_Form_Register]
Do you have any tutorial is talking about that?
i am using Magento 1.7
Thanks very much

Best Regards,
Wilfred

`Reply Or Comment!
Please LogIn to Reply!