Our Couriers require a telephone number for each order.
How can we make the telephone number a required field for customers ?
Printable View
Our Couriers require a telephone number for each order.
How can we make the telephone number a required field for customers ?
admin->configuration->minimum values->telephone number
Set it to at least 5 or 6. Keep in mind this will NOT affect returning customers who already created an account earlier - you'd need to add some custom code to require a phone number from existing customers when they log in or start checkout.
As stated by balihr, the setting (whatever it may be or have been) will have no effect on existing customers. Based on the conversation one might assume that you are referring to orders placed by customers that have established an account after the time that a minimum value of 3 was established; however, the fact is not directly discussed yet.
The suggestion would be to review the affected order history against the customers. Identify when the customers established their account, then if the customers provided a phone number. Also to identify when the setting of 3 was established. From there can diagnose what the issue is and how to accomplish the desired modifications/actions.
I have the same issue. The minimum number has always been set to 3, yet new customers register without a phone number. I'm using v1.5.5d.
Strangely in Configuration>Customer details there is no option to make phone numbers a requirement, while there is an option for almost every other field.
Did anyone resolve this issue?
In what way is your store's /includes/modules/create_account.php (or the copy in /includes/modules/YOUR_TEMPLATE/create_account.php) different from the as-shipped version?
For that processing, if a customer enters a telephone-number of length less than the minimum-configured ... the account will not be created.
Does your store accept payment via PayPal Express Checkout? If so, have the accounts that were created without phone numbers resulting from an express-checkout customer?
did you check the user account phone number for blink spaces? 3 spaces equals 3 characters which creates the field as true when that is not a true phone number! The number is a string field and it's compared to a number by counting the characters like this (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) A set of 3 characters using (strlen) would = 3.
The fix is to use some script to mask the input, basically forcing the user to enter the correct information. The mask I use only allows numbers in the right order for the USA. But we still can't force them to truly enter there phone unless we use SMS and require a key entered to finish the account creation. a phone opt-in-opt-out set of code.
Google maskedinput
which is a jquery set of code.
I placed the code in the template tpl_create_account_default.php file at the bottom and used the class in the tpl_modules_create_account.php You code just use the ID tag if you like.
I also use it in the DOB fieldCode:<script src="<?php echo $template->get_template_dir('jqueryui.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/jqueryui.js' ?>" type="text/javascript"></script>
<script src="<?php echo $template->get_template_dir('jquery.maskedinput.js',DIR_WS_TEMPLATE, $current_page_base,'jscript') . '/jquery.maskedinput.js' ?>" type="text/javascript"></script>
<script>
$(function() {
$("#date")
.datepicker({ nextText: "", prevText: "", changeMonth: true, changeYear: true })
.mask("99/99/9999");
$(".phone") .mask("999-999-9999");
});
</script>
I've tested it myself, and it does not let you submit the page without entering characters in the phone field. Davewest must be right, they must be entering spaces, because the field is blank for some customers...the file must be removing these spaces before saving to the database because there are no spaces in the customer field when I check it.