Magento 1.6 - Adding Custom Fields for Registration Page

后端 未结 2 528
后悔当初
后悔当初 2021-01-24 23:51

I want to modify the registration page to add custom fields which would potentially include

  • Address Details

    • Address Line 1
    • Address Line 2
2条回答
  •  -上瘾入骨i
    2021-01-25 00:27

    Take a look at the customer_setup scripts for reference. For example:

    Mage/Customer/sql/customer_setup/mysql4-upgrade-1.4.0.0.0-1.4.0.0.1.php
    

    This file has an example of how to assign attributes to the customer address form (bottom of file):

    Mage/Customer/sql/customer_setup/mysql4-data-upgrade-1.4.0.0.13-1.4.0.0.14.php
    

    Best practices would be to create a new module with an install script, and put your code in there to add the custom attributes.

    The customer model is an EAV model. EAV is a complicated subject in Magento. A good exercise would be to read up on creating a EAV module -- to understand the basics -- and then come back to adding custom attributes.

    Enterprise allows you to add customer attributes via the admin panel, but unfortunately it's more of a pain for CE.

    That should get you started. Hope this helps.

提交回复
热议问题