Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Removal Of Requirement For Phone Number


Guest

Recommended Posts

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', ' <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', ' <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

Link to comment
Share on other sites

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', ' <small><font color="#AABBDD">obligatorio</font></small>');

 

You can just remove the word "obligatorio" ;)

 

There you have it.

 

---Will

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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... :)

Link to comment
Share on other sites

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:

);

Link to comment
Share on other sites

  • 6 months later...

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.

Link to comment
Share on other sites

  • 3 months later...
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

Link to comment
Share on other sites

  • 4 weeks later...
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

Link to comment
Share on other sites

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. ;)

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...
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.

 

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--

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

 

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

Did you ever figure out how to get the background color switched to white?

Building the web - One Site at A Time

Link to comment
Share on other sites

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:

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 3 months later...
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;

  }

}

}

 

 

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

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;

  }

}

}

Link to comment
Share on other sites

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

 

the porpouse is avoid the fallowing:

 

a pop up apears and say :

line: 101

error:espected an objet

Link to comment
Share on other sites

  • 1 year later...

THANK YOU!!!!! so much. I have been searching this forum for this tip and finally found it. I used it to remove a few fields. This should be in the quick set up for beginners at the beginning :)

Great tip thanks again.

 

 

 

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

Link to comment
Share on other sites

  • 2 weeks later...

I mananage to get the phone number not being required anymore. However, What I want to do is to eliminate the telephone and fax fields entirely from my create_account.php

 

So far I didnt manage without errors. Any help ?

 

Thanks

bb

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...