Hi,
in the checkout page , for non-registerd users , is it possible to replace Full name with First Name , and Last Name ?
the reason is that i noticed too many customers only entering thire first name . It's better to have first and last name , as it became standard in most webforms
Thanks !
First and Last name instead of full name ?
-
- Lieutenant, Jr. Grade (LT JG)
- Posts: 28
- Joined: Wed Jun 04, 2008 1:45 am
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: First and Last name instead of full name ?
We had that problem also. Here is what I changed our onepage checkout to:
OnePageCheckout.ascx
OnePageCheckout.ascx.cs
OnePageCheckout.ascx
Code: Select all
<h2 class="sectionHeader">Billing Address</h2>
<asp:PlaceHolder ID="EnterBillingPanel" runat="server" EnableViewState="False">
<table class="inputForm" cellpadding="3">
<tr>
<th class="rowHeader" width="100">
<asp:Label ID="BillToFirstNameLabel" runat="server" Text="First Name:" AssociatedControlID="BillToFirstName" EnableViewState="false"></asp:Label>
</th>
<td width="120">
<asp:TextBox ID="BillToFirstName" runat="server" EnableViewState="false" Width="110"></asp:TextBox>
<asp:RequiredFieldValidator ID="FirstNameRequired" runat="server" Text="*"
ErrorMessage="Billing first name is required." Display="Static" ControlToValidate="BillToFirstName"
EnableViewState="False" SetFocusOnError="false" ValidationGroup="OPC"></asp:RequiredFieldValidator>
</td>
<th class="rowHeader" width="100">
<asp:Label ID="BillToLastNameLabel" runat="server" Text="Last Name:" AssociatedControlID="BillToLastName" EnableViewState="false"></asp:Label>
</th>
<td width="120">
<asp:TextBox ID="BillToLastName" runat="server" EnableViewState="false" Width="110"></asp:TextBox>
<asp:RequiredFieldValidator ID="LastNameRequired" runat="server" Text="*"
ErrorMessage="Billing last name is required." Display="Static" ControlToValidate="BillToLastName"
EnableViewState="False" SetFocusOnError="false" ValidationGroup="OPC"></asp:RequiredFieldValidator>
</td>
</tr>
Code: Select all
private void InitializeBillingAddress()
{
User user = Token.Instance.User;
Address billingAddress = user.PrimaryAddress;
//BillToName.Text = billingAddress.FullName;
// next 2 lines jme 061908
BillToFirstName.Text = billingAddress.FirstName;
BillToLastName.Text = billingAddress.LastName;
BillToCompany.Text = billingAddress.Company;
BillToAddress1.Text = billingAddress.Address1;
BillToAddress2.Text = billingAddress.Address2;
BillToCity.Text = billingAddress.City;
BillToPostalCode.Text = billingAddress.PostalCode;
if (!billingAddress.IsValid) billingAddress.Residence = true;
BillToAddressType.SelectedIndex = (billingAddress.Residence ? 0 : 1);
BillToPhone.Text = billingAddress.Phone;
BillToEmail.Text = billingAddress.Email;
//INITIALIZE BILLING COUNTRY AND PROVINCE
BillToCountry.DataSource = this.Countries;
BillToCountry.DataBind();
if (billingAddress.CountryCode.Length == 0) billingAddress.CountryCode = Token.Instance.Store.DefaultWarehouse.CountryCode;
SelectCountryAndProvince(BillToCountry, billingAddress.CountryCode, false, BillToProvince, BillToProvinceList, BillToPostalCodeRequired, billingAddress.Province, false);
}
------------------------
private void SaveBillingAddress()
{
User user = Token.Instance.User;
Address billingAddress = user.PrimaryAddress;
//billingAddress.FullName = StringHelper.StripHtml(BillToName.Text);
//jme 061908 next two lines
billingAddress.FirstName = StringHelper.StripHtml(BillToFirstName.Text);
billingAddress.LastName = StringHelper.StripHtml(BillToLastName.Text);
billingAddress.CountryCode = BillToCountry.SelectedValue;
billingAddress.Company = StringHelper.StripHtml(BillToCompany.Text);
billingAddress.Address1 = StringHelper.StripHtml(BillToAddress1.Text);
billingAddress.Address2 = StringHelper.StripHtml(BillToAddress2.Text);
billingAddress.City = StringHelper.StripHtml(BillToCity.Text);
billingAddress.Province = (BillToProvince.Visible ? StringHelper.StripHtml(BillToProvince.Text) : BillToProvinceList.SelectedValue);
billingAddress.PostalCode = StringHelper.StripHtml(BillToPostalCode.Text);
billingAddress.Residence = (BillToAddressType.SelectedIndex == 0);
billingAddress.Phone = StringHelper.StripHtml(BillToPhone.Text);
if (trEmail.Visible) billingAddress.Email = StringHelper.StripHtml(BillToEmail.Text);
billingAddress.Save();
}
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx