Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Customer Number field


Recommended Posts

The customer already has their own ID number.

Where do you need the number to be and what do you need it for?



I use another program to keep track of customers...accounting program...i want to enter the number assigend by that program into oscommerce.

Link to comment
Share on other sites

Here is the code:




1: go to cPanel, then to phpmyadmin, then to the database, then to the customers table, click on the text link (left), then find the "Add Field"


in table customers


Add field(s)At End of Table At Beginning of Table After


customers_account; varchar(20) default NULL




2: Update admin/includes/languages/english.php


define('ENTRY_ACCOUNT_NUMBER', 'Account Number:');




3: Make the following additions to admin/customers.php

The additions are marked with comment tags. So find the original text and insert the commented text


Four additions:



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

// account number 1
$customers_account = tep_db_prepare_input($HTTP_POST_VARS['customers_account']);
// eof account number 1

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




'customers_fax' => $customers_fax,

// account number 2
'customers_account' => $customers_account,
// eof account number 2

'customers_newsletter' => $customers_newsletter);



add c.customers_account, (there is only 1 comment tag, just insert text)


// account number 3 added c.customers_account,

$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_account, c.customers_newsletter, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");




		<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
		<td class="main">
 if ($processed == true) {
echo $cInfo->customers_fax . tep_draw_hidden_field('customers_fax');
 } else {
echo tep_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"');

	  <!-- account number 4 -->
		<td class="main"><?php echo ENTRY_ACCOUNT_NUMBER; ?></td>
		<td class="main">
 if ($processed == true) {
echo $cInfo->customers_account . tep_draw_hidden_field('customers_account');
 } else {
echo tep_draw_input_field('customers_account', $cInfo->customers_account, 'maxlength="32"');
	  <!-- eof account number 4 -->



That's It..........

Link to comment
Share on other sites


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

  • Create New...