Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Checkout how to add a telephone field?


dynamok

Recommended Posts

Guys and Gals,

In the new checkout how do we add a telephone field to the Address Book Entry?

I don't mean the sign up address but the additional addresses, and also make it required.

 

Please help me :(

Link to comment
Share on other sites

The address_book table does not contain a phone number.

 

You would need to add that field like entry_telephone varchar(32)

 

Then, you need to edit the address_book_process.php file to include the new field.

 

It would be similar to create_account.php for the customer_telephone.

Link to comment
Share on other sites

Hi Linda,

This is what I've tried so far:

To the address_book table in the database I added:

entry_telephone varchar(32) NOT NULL default '',

 

In address_book_process.php, on line 41 after:

$lastname = tep_db_prepare_input($HTTP_POST_VARS['lastname']);

I added this:

$telephone = tep_db_prepare_input($HTTP_POST_VARS['telephone']);

 

Then lines 82 to 87 after:

if (strlen($lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {

$lastname_error = true;

$error = true;

} else {

$lasttname_error = false;

}

I added this:

if (strlen($telephone) < ENTRY_TELEPHONE_MIN_LENGTH) {

$error = true;

$entry_telephone_error = true;

} else {

$entry_telephone_error = false;

}

 

Then line 153, after:

'entry_lastname' => $lastname,

I added this:

'entry_telephone' => $telephone,

 

I'm sure I'm missing something since the telephone box does not show up.

Do you see any other fields where I have to edit?

Link to comment
Share on other sites

you need to edit catalog/includes/modules/address_book_details.php and add something simular to the code for last name so php knows to write the field below is the code for last name

 

 

<tr>

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

<td class="main"> 

<?php

if ($process) {

if ($firstname_error) {

echo tep_draw_input_field('firstname') . ' ' . ENTRY_FIRST_NAME_ERROR;

} else {

echo $firstname . tep_draw_hidden_field('firstname');

}

} else {

echo tep_draw_input_field('firstname', $entry['entry_firstname']) . ' ' . ENTRY_FIRST_NAME_TEXT;

}

?>

Link to comment
Share on other sites

  • 2 weeks later...

Can anyone figure this one out? I've tried and no luck.

I have no idea why this is not already part of the Address Book Entry. Really strange.

Please someone help with this.

Link to comment
Share on other sites

I've asked this before, but still no answer.

How would you add a Telephone field in Address Book Entry?

I've tried and with no luck.

I have no idea why this is not already part of this, strange.

 

Please someone help with this :cry:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...