- 🇮🇹Italy finex
Hi, the "reset sequence" is available on the UI. I think this issue can be closed.
To start:
A workflow we've gotten used to in Other Ecommerce Software is to start the order numbers at 1 during site build out and then, when the site is ready to go live, reset the order number to 1000 to symbolize "live orders". This doesn't work with Commerce's number patterns, though, as the "initial number" is only ever used to seed the commerce_number_pattern_sequence
table. After that number has been seeded, the "initial number" configuration is never looked at again. Even if all the orders created using that number pattern are deleted, the value stored in commerce_number_pattern_sequence
remains unchanged.
So, say, we have a number pattern with an initial number of 1, and 3 orders come in. Those orders are numbered 1, 2, and 3. We now want the next order number to be 1000. If we manually UPDATE commerce_number_pattern_sequence SET number = 999 WHERE entity_id = 'example'
, then our workflow works... the next order number that comes in will be 1000. Alternatively, we could edit our number pattern to change the initial number to 1000, then run DELETE FROM commerce_number_pattern_sequence WHERE entity_id = 'example'
and that, too, would work; the next order number would be 1000.
The feature request then boils down to one of:
We do want this sequence fiddling to be user-decided; we can't just "automatically force update the sequence" whenever the number pattern is saved. Consider our "infinite" number pattern above: if we start at initial number 1, and three orders come in (numbered 1, 2, 3), and someone then edits the number pattern WITHOUT changing the initial number of 1, then the sequence would be force updated back down to 1 (or NULL) and the next order would again be numbered 1, causing unwanted (for "infinite") duplicates.
Active
2.0
Number pattern
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Hi, the "reset sequence" is available on the UI. I think this issue can be closed.