Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
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):
[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
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular