Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Giving a user a USER ID


Shadow-Lord

Recommended Posts

I want the USER ID e.g

 

User ID: DQ0001

 

to show up on orders. So if there are any problems this can be quoted.

sure customers wouldn't find this a bit impersonal ?

 

wouldn't the order number be sufficient ?

Your online success is Paramount.

Link to comment
Share on other sites

Well, I incorporated some code to show the customer ID as an account number to show up on invoices and also on the My Account page for the customer.

 

If this is what you want let, me know and I will dig out the code.

 

Not sure how you would add letters to it though, as it's just a number.

Link to comment
Share on other sites

  • 3 weeks later...

OK - this will enter the customer account number, which is the customer ID in the db, into the account details pages under "My Account", just above the first name.

 

Go into catalog/includes/modules/account_details.php

 

Find

 

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

 

Directly BEFORE it, add this:

 

<tr>
           <td class="main"> <?php echo ENTRY_CUSTOMER_ID; ?></td>
           <td class="main"> 
<?php echo $account['customers_id']; ?></td>
         </tr>

 

Then go to english.php andf find:

 

define('ENTRY_GENDER', 'Gender:');

 

Before it, add:

define('ENTRY_CUSTOMER_ID', 'Your Account Number:');

 

Or you can change Your Accout Number to whatever text you want to put there, but keep the rest of the coding.

 

To add the account number to the invoice, open catalog/admin/invoice.php and find:

 

 include(DIR_WS_CLASSES . 'order.php');
 $order = new order($oID);

 

After it, add:

 

$customer_id_query = tep_db_query("select customers_id from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
      $customer_id = tep_db_fetch_array($customer_id_query);

 

Then scroll down and find:

 

 <tr>
       <td class="main"><b><?php echo ENTRY_PAYMENT_METHOD; ?></b></td>
       <td class="main"><?php echo $order->info['payment_method']; ?></td>
     </tr>

 

After it, add:

<tr>
     <td class="main"><b><?php echo ENTRY_CUSTOMER_ID; ?></b></td>
     <td class="main"><?php echo $customer_id['customers_id']; ?></td>
   </tr>

 

Finally, open catalog/admin/includes/languages/english/invoice.php and find:

 

define('ENTRY_PAYMENT_METHOD', 'Payment Method:');

 

After it, add

 

define('ENTRY_CUSTOMER_ID', 'Your account number:');

 

Again, you can change the text to whatever you want.

 

I think that's all I did. If it doesn't work and I missed something out, let me know.

 

This will add the customer's account number underneath the Payment method.

Link to comment
Share on other sites

Whoops, jsut noticed I missed off a < in the first bit of code, which should read

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

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...