Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Show Address Fields in Customer Register/Create Page? 
 
CreedFeed
Member
 
Total Posts:  74
Joined:  2007-08-31
Milwaukee, WI
 

I was browsing the template for the registration form and noticed a piece of code which shows/hides the address fields:

<?php if($this->getShowAddressFields()): ?>

I however could not find anywhere in the codebase where this function is declared, or any location in the admin where I can set a flag to show address fields on the registration form. Can anyone point me in the right direction to finding this, or was this function (getShowAddressFields()) something was not added to Magento at this time?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Pihtt
Jr. Member
 
Total Posts:  16
Joined:  2009-07-03
 

Just add an action tag in customer.xml:

...
    <
customer_account_create translate="label">
        <
reference name="content">
            <
block type="customer/form_register" name="customer_form_register" template="customer/form/register.phtml">
                <
action method="setShowAddressFields"><value>true</value></action>
                <
block type="page/html_wrapper" name="customer.form.register.fields.before" as="form_fields_before" translate="label">
                    <
label>Form Fields Before</label>
                </
block>
            </
block>
        </
reference>
    </
customer_account_create>
 
Magento Community Magento Community
Magento Community
Magento Community
 
vovcheg
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2010-09-10
 

or even simpler,
local.xml layout:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
    <
customer_account_create translate="label">
        <
reference name="customer_form_register">
            <
action method="setShowAddressFields"><value>true</value></action>
        </
reference>
    </
customer_account_create>
</
layout>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top