1

I followed this tutorial to add fields in the registration form of a customer under Magento, I succeed to run the example, but I know that It is not clean, for upates later...

What' the best way to rewrite all the files used in the tutorial, in a clean way :

  • app/design/frontend/default/yourtheme/template/customer/form/register.phtml
  • app/design/frontend/default/yourtheme/template/customer/form/edit.phtml
  • app/code/core/Mage/Customer/Model/Entity/Setup.php
  • app/code/core/Mage/Customer/etc/config.xml
  • app/code/core/Mage/Customer/controllers/AccountController.php

Thanks a lot

clockworkgeek
  • 37,650
  • 9
  • 89
  • 127
Bizboss
  • 7,792
  • 27
  • 109
  • 174

1 Answers1

3

You need to create your own module. Never edit files in app/code/core/ folder. If you want to add functionality to Magento, you need to rewrite the base classes.

Alan Storm has good tutorials to follow:

How to create a simple 'Hello World' module in Magento?

To rewrite a controller (AccountController in your case), and after you create you own module, you can follow this tutorial.

Configure the Layout

In your app/code/local/MyCompany/Module/etc/config.xml:

<?xml version="1.0"?>
<config>
    <frontend>
        <layout>
            <updates>
                <mydesign>
                    <file>myfile.xml</file>
                </mydesign>
            </updates>
        </layout>
(...)

Then you could update your layout in app/design/frontend/default/mydesign/layout/myfile.xml.

Community
  • 1
  • 1
joksnet
  • 2,305
  • 15
  • 18
  • Thanks for the good links joksnet, I have created a module with "module creator", can I now modify the xml file located in"\app\design\frontend\my_company\default\layout\customer.xml" to load my custom phtml files ? – Bizboss Jan 10 '11 at 12:23
  • I don't known how "module creator" works. But check the configuration for your layout update XML in `app/code/local/MyCompany/Module/etc/config.xml`. As I described in the answer. – joksnet Jan 10 '11 at 13:03