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

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:
so your customers will have an even harder time figuring out how your order number works.

Best regards,

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

  • Page:
  • 1

VM - Shopping cart


Cart empty

Login Formular