Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Too much customer account information


motorbelly

Recommended Posts

I am setting up a shop for someone and am being told it wants too much information from the customer.

 

In the admin Customer Info I have everything (gender, DOB, suburb, company, state) set to false but when the customer goes to make an account it still requests street address, phone number, zipcode, and country

 

How can I shut off these information fields or at least make them optional?

 

:blink:

Link to comment
Share on other sites

  • 7 months later...

STEP 1

 

IN includes/languages/english.php

 

FIND

define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

CHANGE TO

define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

 

Do the same for anything else you wish to have optional.

 

STEP 2

 

IN Admin -> Configuration -> Minimum Values

 

SELECT Telephone Number

click EDIT

DELETE any numbers in the field (leave it blank)

click UPDATE

 

Do the same for anything else you edited in Step 1 to be optional.

 

----

 

You can't make country optional; however, this is what I did to get around that since all of my customers would be in the USA.

 

IN /includes/functions/html_output.php

 

FIND

$countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));

 

CHANGE TO

$countries_array = array(array('id' => '233', 'text' => 'USA'));

 

AND

 

FIND

function tep_get_country_list($name, $selected = '', $parameters = '') {

 

ADD ABOVE

if ( empty($selected) ) {$selected = STORE_COUNTRY;}

 

OPTIONALLY, you may wish to remove all the other countries. It's a bit time consuming, but for me, it's a consistency thing.

Link to comment
Share on other sites

WOW!

 

Thank you so much!

 

I wrote that back in November last year and have not been able to use that store at all and that looks like it will do the trick.

 

Tell me you aren't 13 years old. :)

 

Off to work with me...

Link to comment
Share on other sites

Thank you so much!

 

I wrote that back in November last year and have not been able to use that store at all and that looks like it will do the trick.

 

Tell me you aren't 13 years old. :)

 

Off to work with me...

Hey, no problem. I did as much research as possible here on the forums, in the osCommerce knowledgebase, and on OSCdox. When all else failed, I bugged my associate (who knows more PHP than myself) and well, did the good ol' "comment-modify-upload-uncomment-try again-pray to the coding gods it works," method. I'm glad I cleared things up for ya.

 

No, not 13...LOL...a little over double that. Doesn't it just burn you when a kid can get things faster than you? My 3 year old can use the computer better than my dad...it's a generational thing.

 

:D

Link to comment
Share on other sites

For anyone still getting the javascript error (...must contain a minimum of 0 characters), I fixed the javascript instead of going around it.

 

Find this javascript function in includes/form_check.js.php

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

 

On the second line, add: && (field_size > 0)

So the function will look like this:

 

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

 

Now the function checks first to see if the required size is 0, and skips it if true.

 

I hope that helps someone. :huh:

Link to comment
Share on other sites

I have found that if you leave the field blank, you will not get the error. However, if you place a 0 in the field, you will get the error. You may want to try leaving the field blank before altering the code...unless you like hacking it up...then knock yourself out. :)

Link to comment
Share on other sites

  • 3 years later...
  • 6 months later...

Alternatively, you can remove the country select box and make it return the following instead;

 

In html_output.php, find the tep_get_country_list function. Inside it, edit the following

 

return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);

 

into

 

// return tep_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
$country_manual_html .= '<input type=hidden name=country value=160><strong>Norge</strong>';
return $country_manual_html;

 

See the value=160? Thats the country code. Norge means Norway and is my country - that's what the customer see in the form.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...