Results 1 to 7 of 7
  1. #1
    Join Date
    May 2008
    Posts
    261
    Plugin Contributions
    0

    Default generate order ID randomly

    hi, everyone,

    Does anybody know how to made zen-cart to generate order ID in specific format?
    ex. YYMMDDHHmmSS**
    YY: year
    MM: month
    DD: day
    HH: hour
    mm: minute
    SS: second
    **: random number

    if in this format, it exceedes 10 digits, which doest not allowd by the Function INT in zen-cart.

    anybody know how to fix this problem? many appreciated!!

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,691
    Plugin Contributions
    11

    Default Re: generate order ID randomly

    The order number is a table ID and cannot be randomly generated. The YYMMDDHHmmSS is already created with each order and displayed on the Orders Page in the admin panel.

    If you wanted any page to list the Order ID in the YYMMDDHHmmSS## format, you would just need to edit the display to reflect your format.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    May 2008
    Posts
    261
    Plugin Contributions
    0

    Default Re: generate order ID randomly

    hi,dbltoe,

    really appreciate for your quick answers.

    if i want any page to display the YYMMDDHHmmSS## format, where should i edit, or how to enable it?

  4. #4
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: generate order ID randomly

    Quote Originally Posted by Jerry5763837 View Post
    hi,dbltoe,

    really appreciate for your quick answers.

    if i want any page to display the YYMMDDHHmmSS## format, where should i edit, or how to enable it?
    It will involve too much work if you want to have the order id recorded and displayed that way. Ask yourself if it is worth it, it will require significant amount of work to edit all the files related and to make sure things work properly, it will also require significant amount of work when installing other modules that may relate to this part, as well as additional work when upgrading.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #5
    Join Date
    May 2008
    Posts
    261
    Plugin Contributions
    0

    Default Re: generate order ID randomly

    hi, Yellow,

    many thanks for your patient explanation.

    so, it is useless to do like this.

    on other hand, don't you think is it so foolish to gegerate order ID one after another, which would disclose the sales status in site.

    any further suggestions to un-disclose sales status on out site?
    how to edit the order id? thanks

  6. #6
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: generate order ID randomly

    Quote Originally Posted by Jerry5763837 View Post
    hi, Yellow,

    many thanks for your patient explanation.

    so, it is useless to do like this.

    on other hand, don't you think is it so foolish to gegerate order ID one after another, which would disclose the sales status in site.

    any further suggestions to un-disclose sales status on out site?
    how to edit the order id? thanks
    There are 2 approaches:
    1. you can easily set the current order to very high number if you want to
    2. or, you can have an additional field in the order table, in this field you can assign unique string (id) to it, and use it for display purpose etc.
    The nice thing about this approach, is that it doesnt touch the core code, and will not prevent the site from functioning properly
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  7. #7
    Join Date
    May 2008
    Posts
    261
    Plugin Contributions
    0

    Default Re: generate order ID randomly

    option 1: maybe we have to discard this method.
    even though set the beginning new order id to 999999 through admin---tool--store manager, the next order is 1000000 all the same, and the next is 1000001, ......., all order IDs are in sequence, through which customer can learn how many orders you have.

    option 2: coud you please advise how to achieve this?
    thanks for your explanation in advance.

 

 

Similar Threads

  1. Attribute Order displays randomly
    By Stuff4Toys in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 29 Jan 2008, 07:22 AM
  2. Product sort order doesn't work- products display randomly!
    By ajshim in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 4 Dec 2007, 03:16 AM
  3. How to generate an order list by article
    By jojo-466 in forum General Questions
    Replies: 6
    Last Post: 3 Dec 2007, 05:17 PM
  4. Generate XML file upon order completion
    By SteveKim in forum Contribution-Writing Guidelines
    Replies: 10
    Last Post: 28 Oct 2007, 12:14 AM
  5. How do I insert 2 randomly generated letters before order number?
    By Brent2 in forum Templates, Stylesheets, Page Layout
    Replies: 12
    Last Post: 15 Sep 2007, 01:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg