Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Make telephone number optional


Floob

Recommended Posts

Hi,

 

Is there a recommended approach to stop the telephone number being required (on the account sign up page)?

Is it still to edit the code in the file (create_account.php) directly?

 

Thanks

Link to comment
Share on other sites

In create_account.php just comment the lines :

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

      $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
    }
Link to comment
Share on other sites

@@Floob

 

Not sure if this will work or not (there are posts that suggest that it will) but try setting the minimum required field size in admin to "0" and let us know what happens.

 

Dan

Link to comment
Share on other sites

Thanks for both of your suggestions, but neither seems to prevent the validation.

See this image:

 

http://s30.postimg.org/gzkvr9n3l/telno.png

 

I commented the lines like this:

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


      $messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
    }
*/
Link to comment
Share on other sites

@@Floob

 

Allen...I messed with it a bit and this seems to work...

 

replace your existing echo tep_draw_input_field to this...

 echo tep_draw_input_field('telephone', '', 'id="inputTelephone" placeholder="' . ENTRY_OPTIONAL . '"');

Dan

Link to comment
Share on other sites

@@Dan Cole

Thanks - that works (although I changed ENTRY_OPTIONAL to  ENTRY_TELEPHONE_NUMBER)

Still has the red required marker there though - not sure how to remove that.

 

@Artcolnc

What would happen if I dont do that? Would I not be able to update customer info?

Link to comment
Share on other sites

@Artcolnc

What would happen if I dont do that? Would I not be able to update customer info?

 

When/if you ever update a customer's info through the admin side, if the telephone number is still required in the admin side, you will have to enter a phone number. Make sense?

 

Malcolm

Link to comment
Share on other sites

@@Floob

 

Allen you'll find this line just below the line you just changed...

 

echo FORM_REQUIRED_INPUT;

 

Comment it out...

 

// echo FORM_REQUIRED_INPUT;

 

Dan

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...