If you want to hide the telephone number field altogether, there is a 'Hide Telephone Number' mod from econcepts which works. It will also let you have it show and be optional.
http://www.zen-cart.com/index.php?ma...roducts_id=495
If you want to do something yourself:
1. The language which controls the display of the telephone number field is in includes/templates/templatedefault/templates/tpl_modules_create_account.php ( or in includes/templates/YOURTEMPLATE/templates/tpl_modules_create_account.php if you use a custom template).
Code:
<fieldset>
<legend><?php echo TABLE_HEADING_PHONE_FAX_DETAILS; ?></legend>
<label class="inputLabel" for="telephone"><?php echo ENTRY_TELEPHONE_NUMBER; ?></label>
<?php echo zen_draw_input_field('telephone', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', '40') . ' id="telephone"') . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?>
<?php
if (ACCOUNT_FAX_NUMBER == 'true') {
?>
<br class="clearBoth" />
<label class="inputLabel" for="fax"><?php echo ENTRY_FAX_NUMBER; ?></label>
<?php echo zen_draw_input_field('fax', '', 'id="fax"') . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? '<span class="alert">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?>
<?php
}
?>
</fieldset>
You can comment it out to remove the field. Then,
2. The code that checks for the correct number of digits being entered and 'makes' the field required by popping up the error is in includes/modules/create_account.php (around line 230).
Code:
if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_TELEPHONE_NUMBER_ERROR);
}
If you comment that out, it won't check for the error.
3. The code that puts the little red * next to the phone number field is in includes/languages/english.php (or in includes/languages/YOURTEMPLATE/english.php). Change
Code:
define('ENTRY_TELEPHONE_NUMBER_TEXT', '*');
to
Code:
define('ENTRY_TELEPHONE_NUMBER_TEXT', '');
Hope this helps.
Bookmarks