Advanced Ordernumbers for VirtueMart

IMPORTANT ANNOUNCEMENT: Plugin development ceased, all plugins made available freely (GPL)

With great sadness we have to announce that we are ceasing development of all our VirtueMart, WooCommerce and Joomla plugins. Effective immediately, all our plugins -- even those that were paid downloads -- are made available for free from our homepage (GPL license still applies), but we cannot and will not provide any support anymore.

It has been a great pleasure to be part of the thriving development communities of VirtueMart as well as WooCommerce. However, during the last year it became painstakingly clear that in addition to a full-time job, a young family and several other time-consuming hobbies at professional level (like being a professional singer) the plugin development and the support that it requires is not sustainable and is taking its toll. It has been an honor, but it is now time to say good bye!



The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1


Unusual Order Number Format 06 Jun 2016 16:47 #1

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
We've been using the Ordernumber Plugin (v1.6a) for a long time now and it's great, but today it generated an order number that was rather strange.
The format of the order numbers in basic options is HALD# and the minimum digits is set to 6. This gives us order numbers like:
as expected

However, this afternoon we received the following orders:

We have since received orders with the expected format so this is clearly some sort of hiccup, but why? These two orders are different - for differing amounts and to different customers.

Can anybody shed some light onto this behaviour?

Unusual Order Number Format 07 Jun 2016 21:14 #2

Dear Athenacraftsltd,
Did this two orders practically occur at the exact same time?
The only reason I can explain this to happen is a race condition of the two orders being placed at the same time, where the second order came in right between the time the order counter was extracted from the database and the time the incremented value was written back again to the database. That is only a very small fraction of a second.

Technically, VM will append the current date if a number with the same order number already exists. This can only happen, if the second order gets the same counter value, i.e. it requests the value for the counter from the database before the first order has written the updated value to the database...

The only other situation I know is when one manually deletes an order, but does not delete the invoice.

Best regards,

Unusual Order Number Format 08 Jun 2016 09:22 #3

  • athenacraftsltd
  • athenacraftsltd's Avatar Topic Author
I wondered about the time issue - I didn't know quite how VM worked under the hood, but the order date of the first was Monday, 06 June 2016 13:25 and the second Monday, 06 June 2016 13:27. Is there any reason there may have been a delay between extracting the counter and writing it back that could account for this?
  • Page:
  • 1