Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Removal Of Requirement For Phone Number


22 replies to this topic

#1 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 15 September 2003, 01:55

I've seen this requested elsewhere and it's actually a fairly simple process to remove the "Telephone Requirement" on account creation.

In the admin panel select Configuration>Minimum Values
Set the value for "Telephone Number" to blank. This means no characters should be present in the field... not zero ... just blank.

That is the first step. Next step, we'll want to prevent OSC from writing "Required" to the form table after the telephone entry.

Locate the file "english.php" in the following directory: catalog/includes/languages/english.php

Find the following line in "english.php"

define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD"></font>Required</small>');

The simplest way to fix the problem, is to leave the entry and just remove "required" from the line. For example:

define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD"></font></small>');

Save the file and upload to the proper directory on your site.

Now, customers have the option of adding their telephone number, but are not required to.

Hope this helps anyone :)

---Will

#2 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 15 September 2003, 02:00

BTW,

If you are offering your site in different languages then you'll want to change other language entries as well.

For example: espanol.php
Found In: catalog/includes/languages/

The line to be edited would be:
define('ENTRY_TELEPHONE_NUMBER_TEXT', '&nbsp;<small><font color="#AABBDD">obligatorio</font></small>');

You can just remove the word "obligatorio" ;)

There you have it.

---Will

#3 Illicious

  • Community Member
  • 455 posts
  • Real Name:Illicious
  • Location:Shaolin of NYC

Posted 19 September 2003, 03:36

Dunno but i followed your instructions and i get a page error.

I guess yea it works but looks ugly with the error poppin up to the customers.

Using Milestone 2.

#4 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 19 September 2003, 15:32

Ooops, sorry I guess I should have mentioned that this works with CVS 2.2 but I hadn't tested it on MS2 (which I don't have installed).

What is the error?

I do have the files for MS2, so perhaps I can page through them and take a look as to where the difference lies and come up with a solution for you.

#5 Illicious

  • Community Member
  • 455 posts
  • Real Name:Illicious
  • Location:Shaolin of NYC

Posted 20 September 2003, 02:57

I get that medium sized window error, the internet explorer script error saying theres a syntax error line 116 char 28. The view source:

Line 116:
  check_password("password", "confirmation", 5, "Your Password must contain a minimum of 5 characters.", "The Password Confirmation must match your Password.");

Must be some way to do this without getting an error.

#6 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 20 September 2003, 05:04

Hmmm ... The changes that were made should not produce this error since the only real code changes were made using the admin utility.

The changes to the line in "english.php" aren't parsed and therefore will not produce an error because it just writes html to the table.

I'll check the code in both versions anyhow... :)

#7 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 20 September 2003, 05:13

Doh...actually the line is parsed, but it is only a target of another call. Like such and such = this so go here and do this... blah blah.

Also, be certain that you didn't inadvertently remove the end of line tag as shown here:
);


#8 MelC

  • Community Member
  • 24 posts
  • Real Name:MelC.
  • Location:UK

Posted 08 April 2004, 09:22

For 2.2 MS2

In
includes/languages/english.php

change

define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

to

define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

Ie, remove the *

In admin, configuration, minimum values, set telephone number to 0.

Field is no longer required.

#9 whereditgo

  • Community Member
  • 101 posts
  • Real Name:Cyndi Lilkendey

Posted 10 July 2004, 02:33

I have to say thank you, this is just what I needed.

Cyndi
Is it reality or just a dream, for some there is no difference.

#10 sinryder

  • Community Member
  • 555 posts
  • Real Name:Haider

Posted 13 July 2004, 06:07

Quote

For 2.2 MS2

In
includes/languages/english.php

change

define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

to

define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

Ie, remove the *

In admin, configuration, minimum values, set telephone number to 0.

Field is no longer required.

i have done that and its working fine thx , but the background color the box is still yellow is their a way to change that to white

#11 ab4276

  • Community Member
  • 7 posts
  • Real Name:Aaron Blevens

Posted 15 July 2004, 11:49

THANKS!! I spent the last couple hours trying to do this :) Now if I can get my Welcome Voucher to work right I'll be gold :)

#12 andes1

  • Community Member
  • 181 posts
  • Real Name:andrea pataquiva diaz

Posted 08 August 2004, 17:30

Keihan, on Sep 15 2003, 01:55 AM, said:

In the admin panel select Configuration>Minimum Values
Set the value for "Telephone Number" to blank. This means no characters should be present in the field... not zero ... just blank.
I HAVE BEEN falowing the instructions but i have a problem:

a pop up apears and say :
line: 101
error:espected an objet

may be the system have waited for an objet (a number or somethin so).

how cain i fix that.... because if a let the minimun value in blank the error apears. but if i put a number i.e o or 1 the field will be (Required information)

help me please
thanks

#13 Keihan

  • Community Member
  • 17 posts
  • Real Name:Willard Frye

Posted 11 August 2004, 18:00

Quote

For 2.2 MS2

In
includes/languages/english.php

change

define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

to

define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

Ie, remove the *

In admin, configuration, minimum values, set telephone number to 0.

Field is no longer required.

Try this and let me know what happens. When I, initially, created this fix I was using MS1. I just installed MS2 and haven't tried changing the requirement for phone number yet. I think I'm going to attempt to remove the line from appearing altogether and will post that if I come up with a solution. I'm not a PHP coder but I am a fairly good problem solver when it comes to fidgeting with and manipulating code. ;)

#14 Cymru

  • Community Member
  • 43 posts
  • Real Name:Conrad

Posted 20 August 2004, 07:09

Just to say thanks. I found this and made the changes and it works smooth!

JC

#15 --Martin--

  • Community Member
  • 7 posts
  • Real Name:Martin

Posted 06 September 2004, 06:11

Quote

In admin, configuration, minimum values, set telephone number to 0.

That didnt work for me. I got an error saying "Phone number needs to be at least 0 digits long." Selecting the number in the admin min values, and simply deleting it, that worked just fine.

Ok, so now in the admin section, when viewing the details of a customer, how can I get rid of the "Required" text? Even though it is not required any more, that text is still there.

Quote

define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

Ie, remove the *

I found that it is easier to replace the * with the text "Optional" That way the person signing up is cleary told what their options are.

Thanks,
--Martin--

#16 andes1

  • Community Member
  • 181 posts
  • Real Name:andrea pataquiva diaz

Posted 07 September 2004, 01:25

the trick is:

In admin, configuration, minimum values, set telephone number to nothing (no ceros no numbers nothing= blank space).

catalog/includes/languages/english.php

find:
define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

and change by:

define('ENTRY_TELEPHONE_NUMBER_TEXT', 'Optional');

I'm still trying to find any way to correct the error "expected objet"... I'm almost near...

#17 iamkim

  • Community Member
  • 50 posts
  • Real Name:kim

Posted 09 September 2004, 02:25

[quote name='sinryder' date='Jul 13 2004, 01:07 AM'] [QUOTE]

i have done that and its working fine thx , but the background color the box is still yellow is their a way to change that to white [/quote]
Did you ever figure out how to get the background color switched to white?
Building the web - One Site at A Time

#18 andes1

  • Community Member
  • 181 posts
  • Real Name:andrea pataquiva diaz

Posted 10 September 2004, 17:42

ok i'm here again whit the solution

(i guess)

the trick is:

In admin (panel), configuration, minimum values, set telephone number whit 0 (cero, zero).

the next step is: in

catalog/includes/languages/english.php or spanish

find:
define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

and change by:

define('ENTRY_TELEPHONE_NUMBER_TEXT', 'Optional, nothig, viva colombia or whatever you want');

next:

in includes/form_check.js.php find:

function check_input(field_name, field_size, message) {
if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
var field_value = form.elements[field_name].value;

if (field_value == '' || field_value.length < field_size) {
error_message = error_message + "* " + message + "\n";
error = true;
}
}
}

replace to

function check_input(field_name, field_size, message) {
if (form.elements[field_name] && (form.elements[field_name].type != "hidden") && (field_size > 0)) {
var field_value = form.elements[field_name].value;

if (field_value == '' || field_value.length < field_size) {
error_message = error_message + "* " + message + "\n";
error = true;
}
}
}

and that's it.
also you can edit al the fields that you consider important. :rolleyes:

#19 jcall

  • Community Member
  • 3,092 posts
  • Real Name:Jared Call
  • Gender:Male
  • Location:Saratoga Springs, UT

Posted 14 September 2004, 01:30

You also may need to modify catalog/create_account.php and catalog/edit_account.php to remove those pages' requirement for whatever field it is that you are getting rid of.

-jared

#20 noyou

  • Community Member
  • 3 posts
  • Real Name:tgp888

Posted 27 December 2004, 19:58

andes1, on Sep 10 2004, 01:42 PM, said:

ok i'm here again whit the solution

(i guess)


next:

in includes/form_check.js.php find:

function check_input(field_name, field_size, message) {
if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
  var field_value = form.elements[field_name].value;

  if (field_value == '' || field_value.length < field_size) {
    error_message = error_message + "* " + message + "\n";
    error = true;
  }
}
}

<{POST_SNAPBACK}>


What is the function it can realize?

And you change the above code to the following code, why is that? what does it do? Thanks a lot

Quote

replace to

function check_input(field_name, field_size, message) {
if (form.elements[field_name] && (form.elements[field_name].type != "hidden") && (field_size > 0)) {
  var field_value = form.elements[field_name].value;

  if (field_value == '' || field_value.length < field_size) {
    error_message = error_message + "* " + message + "\n";
    error = true;
  }
}
}