Thread: Random Order ID

Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22
  1. #11
    Join Date
    Oct 2007
    Posts
    111
    Plugin Contributions
    0

    Default Re: Random Order ID

    I already have the test order. I just don't know what I'm supposed to do with it. it says complete the information below and then talks about constant language file names, etc. ? Guess I'm just dense lol.

  2. #12
    Join Date
    Mar 2004
    Posts
    16,042
    Plugin Contributions
    5

    Default Re: Random Order ID

    if you test order is the last on
    then go to
    admin -> tools -> store manager reset order number put in whatever you want your new order number to be, hit GO

    thats it,
    Zen cart PCI compliant Hosting

  3. #13
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Random Order ID

    The

    Look-up CONSTANT or Language File defines
    Key or Name:

    etc...

    is completely unrelated to the order number.

  4. #14
    Join Date
    Nov 2007
    Posts
    33
    Plugin Contributions
    0

    Idea or Suggestion Re: Random Order ID

    Random order id is something we have used for years with another cart. I don't think it would be that difficult to setup in ZC if you really want it.

    *************************
    I DO NOT HAVE THE TIME TO TEST THIS RIGHT NOW SO USE AT YOUR OWN RISK AND BACKUP FIRST!!!

    Based on what we used before I would think something along these lines will work...
    First, in your mysql db disable auto-increment for orders.orders_id
    Then, open:
    /includes/classes/order.php
    find ...
    *********************************************
    $sql_data_array = array('customers_id' => $_SESSION['customer_id'],
    *********************************************
    and change to ...
    *********************************************
    $sql_data_array = array('orders_id' => get_random_order_id($random_order_id),
    'customers_id' => $_SESSION['customer_id'],
    *********************************************
    save and upload. Then open includes/functions/functions_general.php and add the following function...
    *********************************************
    function get_random_order_id($random_order_id) {
    global $db;
    $max_order_id_query = $db->Execute("select max(orders_id) from " . TABLE_ORDERS);
    $random_order_id = (int)$max_order_id_query + rand(5,19) ;
    return $random_order_id ;
    }
    **********************************************
    save and upload. Place a test order. Order number should be randomly incremented from + 5 - 19 on every order placed.

    We have used random order numbers for years (in another cart) with 10s of thousands of orders processed, and no problems whatsoever.

    The above code may need some tweaking, so please post and corrections for others to use.
    ZC 1.3.8a on Linux with lots o' mods

  5. #15
    Join Date
    Nov 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: Random Order ID

    Don't use the code listed above - it's incomplete and won't work right.

    I spent some time on getting random order ids working this morning and now have them working perfectly in our store.

    If anyone would like the complete code changes to make this work let me know and I will post them here. It takes all of about 5 minutes to implement.

    My disclaimer goes a little something like this...
    I am no PHP expert. While this option is working fine for me, I can not guarantee that it will do so for you. I also cannot guarantee that you will not suffer data corruption or loss of data, and assume no responsibility should this occur; although I have experienced no such problems. You should backup your entire store and database(s) before attempting this hack. There may be a more prestigious, more correct method of obtaining the same results. If there is, I don't know it.
    That's pretty much it, just use common sense and all should be well.
    ZC 1.3.8a on Linux with lots o' mods

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

    Default Re: Random Order ID

    Again, do NOT get yourself into trouble later with tax(at least here in the US), they are gonna question you about the missing order numbers in between.
    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. #17
    Join Date
    Nov 2007
    Posts
    33
    Plugin Contributions
    0

    Default Re: Random Order ID

    I'm not sure where that is coming from. All I can tell you is that I have never, ever, ever had anyone - accountant, business attorney, or anyone else - even comment about our random order numbers.

    In fact, my companies (all US based) have been selling online since '96, have processed hundreds of thousands of orders accounting for millions of dollars of product sold, and I have never even heard a mention in any way about any sort of necessity for consecutive order numbers until this very thread.

    We sell and process orders from many sites. All our orders are then grouped together into a backend order entry system. Our orders Have Never had any sort of consecutive numbering.

    Many of the larger online retailers also use random order ids. It makes logical business sense in a number of ways.

    Of course, if this is something that matters to you. you could easily insert an additional field in the orders table, and set it to autoincrement. This could be coded so that this number is visible only to you in admin and so it also prints out on your invoices. You could then use that for your consecutive number. This way your customer sees a random number, can still access their order via the random number, you can access their order via the random number, but you also have a consecutive numbering scheme available should you have the need.

    For me, anyway, since this is not now nor has it ever been a problem, and I don't really have the time to implement anything further, I will stick to the simple random increment numbering fix I already have working.

    I would be interested though in finding out why you believe there could be a problem in using random order numbers.
    ZC 1.3.8a on Linux with lots o' mods

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

    Default Re: Random Order ID

    Because I did get into ^^.
    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

  9. #19
    Join Date
    Dec 2007
    Posts
    19
    Plugin Contributions
    0

    Default Re: Random Order ID

    needainstall,

    Could you please post your code? Thansk in advance!

  10. #20
    Join Date
    Sep 2008
    Posts
    95
    Plugin Contributions
    0

    Default Re: Random Order ID

    Quote Originally Posted by needainstall View Post
    Don't use the code listed above - it's incomplete and won't work right.

    I spent some time on getting random order ids working this morning and now have them working perfectly in our store.

    If anyone would like the complete code changes to make this work let me know and I will post them here. It takes all of about 5 minutes to implement.

    My disclaimer goes a little something like this...
    I am no PHP expert. While this option is working fine for me, I can not guarantee that it will do so for you. I also cannot guarantee that you will not suffer data corruption or loss of data, and assume no responsibility should this occur; although I have experienced no such problems. You should backup your entire store and database(s) before attempting this hack. There may be a more prestigious, more correct method of obtaining the same results. If there is, I don't know it.
    That's pretty much it, just use common sense and all should be well.
    You told every thing except, never posted the code to test it in first place.

    ~ Time

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. v154 Random Sort Order
    By Craig Freeburg in forum Setting Up Categories, Products, Attributes
    Replies: 11
    Last Post: 27 Aug 2015, 07:56 PM
  2. Random / Custom Order ID
    By TheOne in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 13 Nov 2010, 10:18 PM
  3. Categories Displaying in Random Order
    By LittleScruffs in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 9 May 2010, 03:24 PM
  4. random recieving order confirmation
    By boydiz in forum General Questions
    Replies: 0
    Last Post: 25 Sep 2007, 12:27 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR