Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Number field


rbresnik

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

Add:

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:

ONE*******

 

$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']);

 

TWO******

 

'customers_fax' => $customers_fax,

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

'customers_newsletter' => $customers_newsletter);

 

THREE*******

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'] . "'");

 

FOUR********

 

		  <tr>
		<td class="main"><?php echo ENTRY_FAX_NUMBER; ?></td>
		<td class="main">
<?php
 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"');
 }
?></td>
	  </tr>

	  <!-- account number 4 -->
	  <tr>
		<td class="main"><?php echo ENTRY_ACCOUNT_NUMBER; ?></td>
		<td class="main">
<?php
 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"');
 }
?></td>
	  </tr>
	  <!-- eof account number 4 -->

 

 

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...