VirtueMart

WooCommerce

Others

Docs

Support

Blog

About

Forum

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!

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Random number collisions

Random number collisions 11 Jun 2017 23:15 #1

  • smartwatcher
  • smartwatcher's Avatar Topic Author
  • Offline
  • Posts: 1
If I have an order number format [year][month]-randomDigit[3] and there is a collision i.e. the plugin comes up with an order number that already exists, does it check for this and pick another random number (as many times as necessary to find a unique order number) ?

Please Log in or Create an account to join the conversation.

Random number collisions 19 Jun 2017 00:59 #2

Dear SmartWatcher,
Short answer: No, the plugin will happily create the same number twice.

Long answer: The idea behind the plugin is to use counters, which will automatically ensure uniqueness. The easiest way to ensure uniqueness without giving customers a hint about your order count is to include both a counter and a random number (please note that the square bracket needs to be around the randomDigit, too):
[year][month]-[randomDigit2]#

This will always create unique order numbers, as the counter will increase if the two-digit random number samples the same number again. Of course, you can even include the counter between two random digits:
[year][month]-[randomDigit]#[randomDigit]
so your customers will have an even harder time figuring out how your order number works.

Best regards,
Reinhold

Please Log in or Create an account to join the conversation.

  • Page:
  • 1

VM - Shopping cart

 x 

Cart empty

Login Formular