company name in place of first/last name for Business customer group?
-
13-12-2019 - |
Question
How can i make the customer group Business request a Company Name
instead of
First Name
or Last Name
. this way when signing up a company i can put in the company info since there wont be any first/last name. i then need the company name to be shown anywhere first/last name is usually shown (invoices, account area, ETC.)
Solution
What is your Magento version?
The idea how to achieve your goal is: Make the last name field optional and hide it, and change the first name label to company. So the first name value of the customer is company name that customer entered, and company name will display on everywhere first name field should be.
So first thing first, make last name field optional:
How to make last name optional in Magento 1.8 , Magento 1.7 eva attributes table name is
eva_attribute
, you can find theattribute_code = 'lastname'
Hide last name field in everywhere(disallowed customer enter last name), there are 4 files should update(maybe more files):
app/design/frontend/default/yourtheme/template/customer/form/register.phtml
Has the HTML form for initial registration Note: this file will also be used for a one-shot database extension
app/design/frontend/default/yourtheme/template/customer/form/edit.phtml
Has the HTML form for edit by customers
app/code/core/Mage/Customer/Model/Entity/Setup.php
Has an array full of customer attributes to use for registration
app/code/core/Mage/Customer/etc/config.xml
Has a description of fields to be used in the forms
app/code/core/Mage/Customer/controllers/AccountController.php
For checkbox option
Reference: Custom Account/Registration Fields
After you update the files, you should register and test the changes is working or not. Test the email content, place order and invoice etc, make sure everywhere only display the company name.
Ohh! one more thing, GOOD LUCK!