Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

phone not required in admin/customers.php


knifeman

Recommended Posts

Posted

I know there are a gazillion posts about making the phone number not required. My site has been doing fine for a few years on the catalog side. I want to edit a customers info via admin/customers.php and I still get the warning if there is no phone number. I cannot save the page unless I put in a number.

In admin minimum values, I have 0 (not blank) for telephone length.

In includes form.check I have this line of code:

//check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");

I also fixed the asterisk for the catalog side.

 

If I edit a customers data via admin and they have no phone number, the error box pops up and says

The 'telephone entry' must have at least 0 characters.

 

In admin/customers.php there are many references to the telephone number. Where do I remove the check on the number? Or, since the error is wrong, I do have zero characters already, do I have a different problem?

 

Tim

Posted

Tim,

 

Remove the input requirement from the create_account.php. Then remove he input field box if you don't want to ask your customers for it.

 

The existing customers, however will still have it in the database.

 

Chris

Posted

Do two things:

 

1) open create_account.php and also account_edit.php and comment out or delete these lines:

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
     $error = true;

     $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
   }

 

2) open includes/form_check.js.php and delete this line:

 

check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Posted

Tim,

 

Remove the input requirement from the create_account.php. Then remove he input field box if you don't want to ask your customers for it.

 

The existing customers, however will still have it in the database.

 

Chris

Thanks Chris, but I don't want to remove it, I only want it optional. I have it optional already on the catalog side, it is in admin that i still have a pop up error.

 

Tim

Posted

Do two things:

 

1) open create_account.php and also account_edit.php and comment out or delete these lines:

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
     $error = true;

     $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
   }

 

2) open includes/form_check.js.php and delete this line:

 

check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");

George,

 

Thanks for that. I already have the second part in place. As to the first part, that will not affect my admin page customers.php will it? I commented out the code you referred to in the admin/customers.php to try it also, but it had no effect on the error box.

 

The phone number is already made optional on the catalog side. It is only when i try to edit a customer record from admin that the error box pops up.

 

Tim

Posted

I finally found it.

In admin/customers.php I commented out this code:

if (customers_telephone == "" || customers_telephone.length < <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>) {
   error_message = error_message + "<?php echo JS_TELEPHONE; ?>";
   error = 1;
 }

 if (error == 1) {
   alert(error_message);
   return false;
 } else {
   return true;
 }

 

Which is around line 321. I originally found code at line 137 that did not seem to change things when commented out.

 

Tim

Archived

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

×
×
  • Create New...