Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    Join Date
    Mar 2012
    Posts
    11
    Plugin Contributions
    0

    Default Making Telephone number a compulsory field

    Our Couriers require a telephone number for each order.

    How can we make the telephone number a required field for customers ?

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Making Telephone number a compulsory field

    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.

  3. #3
    Join Date
    Mar 2012
    Posts
    11
    Plugin Contributions
    0

    Default Re: Making Telephone number a compulsory field

    Thank you for your reply.

    I went it and changed it to 6 but the value there was 3 so not sure why this did not prevent the customer from being able to place an order without a telephone number.




    Quote Originally Posted by balihr View Post
    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.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,734
    Plugin Contributions
    17

    Default Re: Making Telephone number a compulsory field

    Quote Originally Posted by aovc View Post
    Thank you for your reply.

    I went it and changed it to 6 but the value there was 3 so not sure why this did not prevent the customer from being able to place an order without a telephone number.
    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.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Making Telephone number a compulsory field

    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?
    Last edited by ttfan; 31 Mar 2017 at 01:19 AM.

  6. #6
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,499
    Plugin Contributions
    88

    Default Re: Making Telephone number a compulsory field

    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.

  7. #7
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Making Telephone number a compulsory field

    Quote Originally Posted by lat9 View Post
    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.
    As far as I know, that file has no differences, yet we have a few new customers with no phone number in the field.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,499
    Plugin Contributions
    88

    Default Re: Making Telephone number a compulsory field

    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?

  9. #9
    Join Date
    Dec 2007
    Location
    Payson, AZ
    Posts
    1,076
    Plugin Contributions
    15

    Default Re: Making Telephone number a compulsory field

    Quote Originally Posted by ttfan View Post
    As far as I know, that file has no differences, yet we have a few new customers with no phone number in the field.
    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.
    Code:
    <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 also use it in the DOB field
    Dave
    Always forward thinking... Lost my mind!

  10. #10
    Join Date
    Jul 2010
    Location
    Australia
    Posts
    231
    Plugin Contributions
    0

    Default Re: Making Telephone number a compulsory field

    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.

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. How do I remove the telephone number field from signup?
    By blackwolf in forum General Questions
    Replies: 11
    Last Post: 3 Jun 2023, 01:10 AM
  2. v153 Telephone number gives error when minimum value is any number above zero
    By Graniteman22 in forum General Questions
    Replies: 21
    Last Post: 8 Oct 2014, 05:38 AM
  3. After upgrade, telephone number field is empty
    By jarvis_ht2000 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 2
    Last Post: 14 Oct 2010, 04:18 AM
  4. Compulsory Field
    By aminut in forum General Questions
    Replies: 2
    Last Post: 27 Jan 2010, 08:42 AM
  5. Making Telephone Number Optional while registration
    By starruby in forum General Questions
    Replies: 4
    Last Post: 13 Mar 2008, 01:45 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR