Magento – How to display customer attribute on frontend in magento

attributescustomermagento-1.7

I have created module using http://silksoftware.com/magento-module-creator, in my module i have created three customer attributes to be displayed in admin and in frontend registration.

The fields get displayed in admin area, but it is not getting displayed in frontend registration form. When I click on Continue button in registration form it is giving me alert to enter those fields (fields created using module) but those are not displayed.

Can anyone have any idea about this??

Best Answer

The validation is added via the customer_form_attribute but it appears you already have that sorted :)

From the display side the option I prefer is to update the registration template via xml and then add these fields into the new template.

For example you could update the customer creation form using the layout handle customer_account_create

<customer_account_create>
    <reference name="customer_form_register">
        <action method="setTemplate"><template>your/customer/form/register.phtml</template></action>
    </reference>
</customer_account_create>

Note that this will only change the account create and you should also think about using the handles checkout_onepage_index and customer_account_edit