Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

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);

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...