Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to remove Telephone and Fax fields?


sandfox

Recommended Posts

I guess when problems start rolling there is no stopping them.

 

What I need to do is to remove the Telephone and fax number requirements from the create account page so it doesn’t cause any problems with the database.

 

I’ve figured I could just delete the PHP error check for the telephone input and delete the table that displays Your Contact Information with the phone and fax input fields. I am hesitant to do this without approval, as my shop is already online. Would such simple deletion of a required field mess anything up? :blush:

Link to comment
Share on other sites

I guess when problems start rolling there is no stopping them.

 

What I need to do is to remove the Telephone and fax number requirements from the create account page so it doesn’t cause any problems with the database.

 

I’ve figured I could just delete the PHP error check for the telephone input and delete the table that displays Your Contact Information with the phone and fax input fields. I am hesitant to do this without approval, as my shop is already online. Would such simple deletion of a required field mess anything up? :blush:

Look for create_account.php in the catalog folder or root directory of your site.

Open the file and look for these lines.

 

<td class="main"><?php echo ENTRY_TELEPHONE_NUMBER; ?></td>

<td class="main"><?php echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>

<td class="main"><?php echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>

 

I prefer to comment instead of delete just in case I will need them in the future. It's easy to undo.

Place a comment (//) in the following lines, seen in red, to prevent Telephone and Fax from showing in create account page.

 

<td class="main"><?php //echo ENTRY_TELEPHONE_NUMBER; ?></td>

<td class="main"><?php //echo tep_draw_input_field('telephone') . ' ' . (tep_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></td>

</tr>

<tr>

<td class="main"><?php //echo ENTRY_FAX_NUMBER; ?></td>

<td class="main"><?php //echo tep_draw_input_field('fax') . ' ' . (tep_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="inputRequirement">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></td>

 

Have fun! :thumbsup:

Link to comment
Share on other sites

Thanks for trying BryceJr, but you don't really know. My question wasn't whether to comment out or to delete. Your suggestion would just "hide" the telephone and fax fields. And because the telephone field is a required field, it would cause an error. Like I said, I can remove the error check but I'm not sure if that wouldn't cause a database error.

Link to comment
Share on other sites

  • 2 weeks later...
I guess when problems start rolling there is no stopping them.

 

What I need to do is to remove the Telephone and fax number requirements from the create account page so it doesn’t cause any problems with the database.

 

I’ve figured I could just delete the PHP error check for the telephone input and delete the table that displays Your Contact Information with the phone and fax input fields. I am hesitant to do this without approval, as my shop is already online. Would such simple deletion of a required field mess anything up? :blush:

To remove the telephone field along with the requirement for them, first you gotta set the min required characters to 0 in your admin/configuration. Then, edit /catalog/includes/languages/english.php.

 

Find this around line 200:

define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Invalid Telephone Number.' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');
define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');

 

remove * so it looks like this:

define('ENTRY_TELEPHONE_NUMBER', 'Telephone Number:');
define('ENTRY_TELEPHONE_NUMBER_ERROR', 'Invalid Telephone Number.' . ENTRY_TELEPHONE_MIN_LENGTH . ' characters.');
define('ENTRY_TELEPHONE_NUMBER_TEXT', '');

 

Then you can remove the field for it as BryceJr explained.

 

Repeat for the fax number.

 

hope this helps.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...