Problem:
The sequence of indexation of orders goes down like this: orders are from 1-20 in order, then jumps to 40 and further in order for some time. And periodically this happens. Tell me, if someone came across a similar or knows the principle on which this index is affixed.
Problem:
The sequence of indexation of orders goes down like this: orders are from 1-20 in order, then jumps to 40 and further in order for some time. And periodically this happens. Tell me, if someone came across a similar or knows the principle on which this index is affixed.
Share Improve this question asked Feb 14, 2019 at 8:36 Anton VusatuiAnton Vusatui 1112 bronze badges 02 Answers
Reset to default 1That's right, it should be. The order number is the record ID in the database. ID is an auto-increment surrogate key. "Missed" IDs can belong to revisions, drafts, media files, etc.
The order IDs are out of order as WordPress saves everything as a post. For example, each pages are posts, media files are posts, products are posts, orders are posts, and posts are posts. Each post is assigned a post_id. All of these posts (media, pages, posts, etc) use the same database table and because of that they can't share the same post ID.
If you want to have consecutive order numbers then I would recommend the following plugins:
- WooCommerce Sequential Order Numbers (free)
- WooCommerce Sequential Order Numbers Pro (paid)
Using the free version will allow you to start your order numbers from your last highest order number. For example, if your last order number was #4861, using this plugin will start your next order at #4862.