Viewing 5 replies - 1 through 5 (of 5 total)
  • Order numbers may NOT be sequential but NEVER was random.
    The value used for the order-id was taken from the database, from “posts” table, according to the “order item” tables “id” variable, etc.

    So, if any new data is recorded to the database then that counter will increase, and when there is a new order then it will take a bigger value then the latest order, not just +1. But if no new data recorded to the database between orders, then the id-s look sequential.

    So, originally, the order-id values seemed like a random array, but it is just because having any gap or not.

    To make the order-id’s sequential, some extensions are needed,
    like:
    https://www.woothemes.com/products/sequential-order-numbers-pro/

    Thread Starter strue

    (@strue)

    Hi, thanks for response,
    you are right is not random but was sequential +2 or +3 and don’t remember if add post or page. Indeed i can’t see in woocommerce changelog modified in this sense. Anyway not there a function or filter to use random order without install plugin and extensions?

    I was trying to say,
    that “randomness” or “sequential” look was just an illusion.

    In fact, if there are some other records between orders, then the order id will not be +1, it will change according to the inputs recordede to the table.

    But if there is no change between orders, then there won’t be any gap between order ids, just +1. So maybe in your previous experiences, to have some increments like +2, +3 all depends on that other changes made in your side wide.

    Btw, it is a site-wide change, not just only order manegements, changes, or Woocommerce inputs.

    In one of my test configuration, order ids for the last week line up like this:
    2617
    2616
    2615
    2612
    2585
    2584
    2581
    2580
    2579
    2574

    That big-gap (2585~2612) was occured when I made lots of updates, change some prices and add some news, etc…

    Btw, that extension was to make those ids sequential, for official/invoice needs.

    For the exact source of that order-id value,
    you can check it from your database,
    the “xxx_post” table.

    the “ID” value becomes “order id” where the “post title” values have “Order…” info.

    Those are also stored in another table: xxx_woocommerce_order_items
    “order_item_id” is the tables sequential id value, and the “order_id” links to those post-ids on the other table…

    etc…

    Thread Starter strue

    (@strue)

    Yes i checked you are right!
    The problem is if want make only order id random between a certain number. Example : from 12345 (5 number) to 1234567 (7 number) it’s is possible to make this?
    Anyway thanks for info

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘random number order’ is closed to new replies.