Require Phone Number

For general questions and discussions specific to the AbleCommerce GOLD ASP.Net shopping cart software.
Post Reply
kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Require Phone Number

Post by kwikstand » Tue Oct 08, 2013 4:51 pm

How can I require a phone number for orders? I need it for shipping.

Thanks,

Scott
Contractor's Solutions
www. contractors-solutions.net

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Require Phone Number

Post by mazhar » Thu Oct 10, 2013 2:28 am

Edit Website/Checkout/ShipAddress.aspx and locate following code

Code: Select all

<asp:TextBox ID="Phone" runat="server" MaxLength="30" Width="100"></asp:TextBox>
and update it like

Code: Select all

<asp:TextBox ID="Phone" runat="server" MaxLength="30" Width="100"></asp:TextBox>
                                                    <span class="requiredField">*</span>
                                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Text="*"
                                                        ErrorMessage="Phone number is required." Display="Static" ControlToValidate="Phone" ValidationGroup="AddrBook"></asp:RequiredFieldValidator>

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Thu Oct 10, 2013 7:10 am

Thanks Mazhar, but my file doesn't contain that line of code. I am using AC Gold 7.0.8.5731
Contractor's Solutions
www. contractors-solutions.net

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Require Phone Number

Post by Katie » Thu Oct 10, 2013 8:04 am

It should be there. I just checked for build 5731. Make sure you're not looking in the wrong file. There is also a file named Shipaddresses.aspx. You need to be looking in Shipaddress.aspx
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Thu Oct 10, 2013 9:02 am

Thanks Katie. You were right, I was looking at the wrong file. It works well now. The only things is, I tried to edit the Text to "Telephone for shipping" and the error message to "•Telephone number is required for shipping." and it doesn't change what is displayed.

I just want to let customers know why we need their phone number. I suspect the ones who don't enter it are concerned about giving out their phone numbers. When I try to find their number, it is usually unlisted.
Last edited by kwikstand on Thu Oct 10, 2013 10:52 am, edited 1 time in total.
Contractor's Solutions
www. contractors-solutions.net

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Require Phone Number

Post by Katie » Thu Oct 10, 2013 9:22 am

Hmm. Maybe it's cached? Have you tried to make a small change to the web.config file? This will recompile the application without having to access the server and restart IIS.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Mon Oct 14, 2013 7:55 am

Well, I implemented the phone # required field, and now I just had a customer order without a phone # again. So I guess it doesn't work.
Contractor's Solutions
www. contractors-solutions.net

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Require Phone Number

Post by Katie » Mon Oct 14, 2013 3:05 pm

Did you test this yourself? I just did, and it certainly looks like it's working. On the new shipping address page, this message appears "Phone number is required for shipping." I have to enter one to complete the form.

Is it possible that the customer you are talking about already had his shipping address stored?
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Mon Oct 14, 2013 3:58 pm

Yes, I know. I checked it when I initiated the change, but I have since received an order that has no phone #. His purchase was made on 10/11/2013 and I made the phone # required on 10/10/2013. You can see the date on the forum post when I made the change. So I don't know how he made the purchase without a phone #.
Contractor's Solutions
www. contractors-solutions.net

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Require Phone Number

Post by Katie » Mon Oct 14, 2013 5:00 pm

Is it possible that the customer you are talking about already had his shipping address stored?
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Mon Oct 14, 2013 5:41 pm

His account was registered at the time of sale.
Contractor's Solutions
www. contractors-solutions.net

User avatar
Katie
AbleCommerce Admin
AbleCommerce Admin
Posts: 2651
Joined: Tue Dec 02, 2003 1:54 am
Contact:

Re: Require Phone Number

Post by Katie » Tue Oct 15, 2013 4:31 am

It's hard to say how this customer slipped through. If you have page tracking enabled, you can go to to his account profile and check to see which pages he viewed before and during checkout. If he happened to create an account and go directly to the Address Book page, then it would have been possible. This is the page I'm referring to: /Members/EditMyAddress.aspx

You might have to apply the code there too. Although, it would seem unlikely that someone would add shipping addresses before checking out, but I'm sure it's possible.
Thank you for choosing AbleCommerce!

http://help.ablecommerce.com - product support
http://wiki.ablecommerce.com - developer support

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Tue Oct 22, 2013 8:05 am

I just had another sale with no phone #. I thought that maybe he edited his info after the sale. I checked the email notification (I have one sent to myself as well as the customer) and realized that the phone # is not included in the emails. How would I do that?

Thanks,

Scott
Contractor's Solutions
www. contractors-solutions.net

jguengerich
Commodore (COMO)
Commodore (COMO)
Posts: 436
Joined: Tue May 07, 2013 1:59 pm

Re: Require Phone Number

Post by jguengerich » Thu Oct 24, 2013 7:56 am

You need to add a line of code to the /App_Data/EmailTemplates/1/CustomerOrderNotification.html file.

Find the following:

Code: Select all

<td class="Email" valign="top">
<strong>Ship To:</strong>
<div style="padding-left:30px;">
$shipment.FormatToAddress(true)
Right after that, add the line:

Code: Select all

<br />$shipment.ShipToPhone
I was going to suggest adding the format parameter to the FormatToAddress() method call, but I couldn't figure out how to get the line breaks passed correctly. If anyone else knows, I'm curious how to do it. This just puts the characters "\r\n" between each field:

Code: Select all

$shipment.FormatToAddress("[Company]\r\n[Name]\r\n[Address1]\r\n[Address2]\r\n[City_U], [Province_U] [PostalCode]\r\n[Country_U]\r\n[Phone]",true)
This results in blank lines if any of the fields are blank (I guess you could fix this by modifying the appropriate AddressFormatter.Format method if you have the source code):

Code: Select all

$shipment.FormatToAddress("[Company]<br/>[Name]<br/>[Address1]<br/>[Address2]<br/>[City_U], [Province_U] [PostalCode]<br/>[Country_U]<br/>[Phone]",true)
I think you can see what they entered by pulling up the order on the Admin side and going to the Addresses tab. The address info (including phone) appears to be saved with the shipment, so it should remain as originally entered, even if they later change the entry in their address book.
Jay

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Wed Oct 30, 2013 8:06 am

I made the modifications and it works. Thanks for the help.

I am also wondering about customers that use Paypal to check out. They are taken directly to Paypal's site for payment. I don't know how that info gets back to my website.
Contractor's Solutions
www. contractors-solutions.net

kwikstand
Commodore (COMO)
Commodore (COMO)
Posts: 410
Joined: Mon Feb 19, 2007 8:12 pm
Contact:

Re: Require Phone Number

Post by kwikstand » Thu Oct 31, 2013 11:08 am

I just figured out that all of my orders without a phone # went through the Paypal Express checkout. That is what the problem is.
Contractor's Solutions
www. contractors-solutions.net

Post Reply