$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>WooCommerce - Inconsistent Indexing of Orders|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

WooCommerce - Inconsistent Indexing of Orders

matteradmin10PV0评论

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 0
Add a comment  | 

2 Answers 2

Reset to default 1

That'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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far