How to Add Alpha Numeric Prefix and Suffix in E-mail Ubercart Invoice Order Number Without Link.

Downloads


If your e-mailed invoice order number looks like the following:

Order #: 51

Now, you want to change it to something like:

AX2345-51-BM4231

This is what you should do.

Installed the uc_register_invoice module. Follow the instruction as given for that module. Make a copy of the uc_order_customer.tpl that is inside the core Ubercart module/uc_order/templates. Rename the file as per instruction, and place the copy of that file inside your theme folder. Now, open the file. Look for the following line that is around #170:

<?php
print $order_link;
?>

This is the incremented order number.

Here is how to add the prefix:

<?php
print t('AX2345-');
?>
<?php
print $order_link;
?>

The code "

<?php
print t('AX2345-');
?>

is the preffix.

To add the suffix now:

<?php
print t('AX2345-');
?>
<?php
print $order_link;
?>
<?php
print t('-BM4231');
?>

The code "

<?php
print t('-BM4231');
?>

is your suffix.

Your e-mail invoice number will look like this: (With number 51 being a link)

AX2345-51-BM4231

Your final code should look like this without a link.

<?php
print t('AX2435-');
?>
<?php
$order_id
= $order->order_id; print $order_id;
?>
<?php
print t('-BM4231');
?>

The result without the link is:

AX2345-51-BM4231

Notice that you can change AX2345 and BM4231 to whatever your heart desires. Since the number 51 gets incremented and is in the middle between the prefix and the suffix, you can remove the suffix if you want to place the incremental number at the end. There is no need to touch your database id.

ENJOY!!!