VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Payment Modules => Topic started by: jaguar on June 29, 2006, 14:34:14 PM

Title: Difference between order_id and order_number
Post by: jaguar on June 29, 2006, 14:34:14 PM
What is the difference between order_id and order_number?

If the order_id is the unique identifier, what is the order_number for?

Pablo
Title: Re: Difference between order_id and order_number
Post by: Soeren on June 29, 2006, 17:27:57 PM
The order_id is the auto_increment field in the table "jos_vm_orders" that counts from 1 to xxxx. It identifies the order.

The order_number identifies the order as well, but it is a random md5 hash. That allows you to display a link to an order without an easy-to-guess ID.

ciao, Soeren
Title: Re: Difference between order_id and order_number
Post by: chirng on July 17, 2006, 10:36:26 AM
so, how to create a random md5 hash?

Please let me know asap, TQ.

Al chirng
Title: Re: Difference between order_id and order_number
Post by: ViperFish on July 24, 2006, 18:35:27 PM
I'm trying to read values from an Oscommerce orders table and insert them into a VM table. But, how do I create the order_number with SQL?
Title: Re: Difference between order_id and order_number
Post by: Soeren on July 24, 2006, 21:34:30 PM
Hi,

use the MySQL function MD5.

http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html#function_md5

Just use some random values like the order time and ID to create different random md5 hashs.

ciao, Soeren