Welcome, Guest
Username: Password: Remember me

TOPIC: Random number collisions

Random number collisions 11 Jun 2017 23:15 #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) ?
The administrator has disabled public write access.

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,
The administrator has disabled public write access.

VM - Shopping cart


Cart empty

Login Formular