Jump to content
Sign in to follow this  

duplicate invoice number

Recommended Posts

Used the following codes in authorizenet_aim.php inside before_process function. It works fine when the traffic is small. It sometimes produces duplicate invoice number passing to authorize net when the traffic is heavy or the orders were placed close each other though. Any suggestion to fix it? Thanks for any help in advance.


$last_order_id = tep_db_query("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");


$last_order = mysql_fetch_array($last_order_id);


$new_order_id = $last_order['orders_id'];


$new_order_id = ($new_order_id + 1);

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this