Post by ktriggs » Fri Jan 20, 2012 11:26 pm

Hello all,

I've been trying to add a prefix of ON to the order numbers and cannot get the SQL syntax correct, or something. I have read this topic: http://forum.opencart.com/viewtopic.php ... 0&start=20 and still couldn't figure it out.

Here is what I've been using: ALTER TABLE `order` AUTO_INCREMENT ='ON10123'

What is the correct syntax?

Thanks!

New member

Posts

Joined
Thu Oct 20, 2011 7:38 am
Location - Lincoln, Nebraska

Post by d7a7z7e7d » Sat Jan 21, 2012 3:38 am

You cannot do this with SQL. The order ID column must be an integer and the "prefix" they were discussing in that thread was in regards to the database table name prefix, not an order ID prefix.

The only way to do this is to modify the core templates to add the prefix every where the order ID is displayed. So instead of <?php echo $order_id; ?> you'd do something like <?php echo "ON" . $order_id; ?>. However, it would be wise to define the prefix in a central location and then have the controllers pass the prefix to the views. This way if you ever wanted to change the prefix you could do it in one place.

I offer custom development, if you would like to have me quote you on this feature just contact me at:

http://www.opencartworld.com/contact

Image
OpenCart Extensions, Technical Support & Custom Development | Have I helped you?


User avatar
Active Member

Posts

Joined
Fri Sep 17, 2010 5:51 am
Location - USA

Post by jmagro » Fri May 24, 2013 8:52 pm

I figured out which files to edit in order to make the order ID prefix show up on order receipts and in the admin panel. Can anyone tell me which file I would edit to have the order ID prefix show up in authorize.net?

New member

Posts

Joined
Thu May 12, 2011 3:31 am

Post by ajm » Fri May 31, 2013 2:45 am

jmagro wrote:I figured out which files to edit in order to make the order ID prefix show up on order receipts and in the admin panel. Can anyone tell me which file I would edit to have the order ID prefix show up in authorize.net?
Can you let us know which files you edited. I wish to have the order prefixed with "CC"

ajm
Newbie

Posts

Joined
Thu Sep 01, 2011 10:31 am
Who is online

Users browsing this forum: No registered users and 53 guests